Why this matters
Improves readability and ensures consistent filtering/mapping.
Factor repeated LINQ predicates/projections into reusable expressions or methods.
Improves readability and ensures consistent filtering/mapping.
Side-by-side examples engineers can pattern-match during review.
var q1 = ctx.Users.Where(u=>u.Active && !u.Deleted);
var q2 = ctx.Admins.Where(a=>a.Active && !a.Deleted);Expression<Func<IHasFlags,bool>> active = e => e.Active && !e.Deleted;
var q1 = ctx.Users.Where(active);
var q2 = ctx.Admins.Where(active);Where(x=>x.Active && !x.Deleted) repeatedExpression predicate reusedFrom the same buckets as this rule.