Comparing Strings in Linq

I like this method best

var customer = db.Customers.Where(d => string.Compare(d.Email,email,true)==0).FirstOrDefault();

It replaces the ToUpper() comparison and is nice and clean

Comments

Popular posts from this blog

Linq Exclude from separate list

Sorting Ascending and Descending

Linq Query Syntax vs Method Syntax