Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even more stuff #1

Open
Laoujin opened this issue Jan 23, 2025 · 2 comments
Open

Even more stuff #1

Laoujin opened this issue Jan 23, 2025 · 2 comments

Comments

@Laoujin
Copy link
Member

Laoujin commented Jan 23, 2025

using, IDisposableAsync, blocks

void Multiply<T>(T a, T b) where T : INumber<T>
{
    var result = a * b;
}

pattern matching:
is (not) null

@Laoujin
Copy link
Member Author

Laoujin commented Jan 23, 2025

public record Test(IEnumerable<string> Moons) { }

[Fact]
public void Testy()
{
    var t1 = new Test(new[] { "Aie" });
    var t2 = new Test(new[] { "Aie" });
    var result = t1.Equals(t2);
    Assert.True(result); // Fails
}

[Fact]
public void Testy2()
{
    var col = new[] { "Aie" };
    var t1 = new Test(col);
    var t2 = new Test(col);
    var result = t1.Equals(t2);
    Assert.True(result); // Succeeds
}

@Laoujin
Copy link
Member Author

Laoujin commented Jan 23, 2025

Linq: CountBy, AggregateBy

  • Small refresher on Deferred execution?
  • Multiple looping over IEnumerable?
  • IEnumerable vs IQueryable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant