MaxBy is a nice LINQ extension which was released as part of .NET 6 in November 2021. It allows us to find the item with the max value for a particular property in a collection.
Simple example below…
You might also be interested in...
In .NET 6 the ZIP LINQ extension can now support merging three sequences togetherIn .NET 6 the ZIP LINQ extension can be used to merge elements from three sequences together. Previously it was … Continue reading In .NET 6 the ZIP LINQ extension...
.NET 7 (Preview) available on Azure App Service as extension
.NET 7 will be released in November and as of the time of writing we are on Preview 5. If … Continue reading .NET 7 (Preview) available on Azure App...
In C# use the nameof() expression so your property, class and namespace references are type safe
In C# if you’re referencing property, class or namespace names in your code use the nameof() expression rather than strings … Continue reading In C# use the nameof() expression so...
Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details
You may see this exception when doing a DbContext.SaveChanges() call. You then may go drilling into the exception details to … Continue reading Validation failed for one or more entities....
Converting images to WebP format in Visual Studio with the WebP Toolkit extension
If your here I’m assuming you already know a little about it Googles WebP image format. If not check out … Continue reading Converting images to WebP format in Visual...