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
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