Hot answers tagged

3

While aepot answer is a good answer and got my upvote it does only work for type int. Which I know the question for an example uses int in their code but if wanting it to work for all data types will need to change the code a bit. public static class EnumerableExtensions { public static IEnumerable<TSource> FilterRepeatingElements<TSource>(...


2

Overall, the code is good on a technical level. This answer addresses the design philosophy behind it, because I think you've overthought the default size approach to the point of generating more work and complexity without actually adding value. We've all been there :-) The Size.Default is used in situations where the image is required in the size it was ...


1

DbContext is a Repository and Entity Framework uses Unit of Work pattern to wrap it, so if you need to wrap DbContext with a Repository you will need to narrow it down to more focused scope. You'll find some arguments about wrapping a repository with another repository (e.g. using repository with EF). Generally, it's not about right or wrong, but it's about ...


Only top voted, non community-wiki answers of a minimum length are eligible