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
Related Tags
.net × 1135c# × 1039
performance × 93
vb.net × 70
object-oriented × 56
multithreading × 56
linq × 56
design-patterns × 47
asp.net × 44
winforms × 43
strings × 37
beginner × 35
algorithm × 34
entity-framework × 34
wpf × 34
generics × 30
asynchronous × 29
reflection × 26
mvp × 26
sql × 25
security × 24
thread-safety × 24
async-await × 24
cryptography × 23
datetime × 22