var results = SomeCollection.Where(c => c.SomeProperty < 10)
.Select(c => new { c.SomeProperty, c.OtherProperty });
The same thing in query syntax: var results = from c in SomeCollection
where c.SomeProperty < 10
select new { c.SomeProperty, c.OtherProperty };
Then you can iterate over both the same way: foreach (var result in results)
{
Console.WriteLine(result);
}
* FluentValidation: excellent validation library, keeps validation rules grouped together and easy to keep track of - https://github.com/JeremySkinner/FluentValidation
* AutoFixture: great for the "Arrange" phase of unit tests. Populates object graphs with test data, highly customizable. There's a bit of a learning curve. Pairs nicely with xUnit but can be used with any TDD library - https://github.com/AutoFixture/AutoFixture
* Shouldly: a different approach to unit test assertions using "Should" that I find more readable. Also had friendlier error messages when assertions failed - https://github.com/shouldly/shouldly
Shameless plug of my own library:
* Regextra: aims to solve some common regex related scenarios. Features a Passphrase Regex Builder to generate a pattern for passphrase criteria, and also supports named templates and a few utility methods - https://github.com/amageed/Regextra