Serio chcesz się uczyć programowania od Hindusów?
Nie wiem co ten człowiek tworzy. Pomijając bezpośrednie operowanie na repozytoriach w kontrolerach, które przeczy idei MVC, gość zamiast wstrzykiwać UoW do repozytoriów, trzyma wszystkie możliwe (jego zdaniem) repozytoria w UoW. Skrajne niezrozumienie tematu.
Zresztą, gość twierdzi, że jest architektem, a nie wie o podstawach:
Found a very interesting comment for this article which i think is worth putting in the article.
There are at least 2 overloads for 'Where' method:
Hide Copy Code
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate);
public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate);
When we are using
Hide Copy Code
Func<T, bool>
the query will use the 'IEnumerable' version. In this case, the whole table records will be fetched from the database first and then the predicated will be applied to the final result. To prove it, just check out the produced SQL. It has no where clause.
To fix this issue, we need to change the 'Func' to 'Expression Func'.