This is a purely academic question, but what's the difference between using == and .Equals within a lambda expression and which one is preferred?
Code examples:
int categoryId = -1;
listOfCategories.FindAll(o => o.CategoryId == categoryId);
or
int categoryId = -1;
listOfCategories.FindAll(o => o.CategoryId.Equals(categoryId));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…