How to modify only one or two field(s) in LINQ projections?
问题 I have this LINQ query: List<Customers> customers = customerManager.GetCustomers(); return customers.Select(i => new Customer { FullName = i.FullName, Birthday = i.Birthday, Score = i.Score, // Here, I've got more fields to fill IsVip = DetermineVip(i.Score) }).ToList(); In other words, I only want one or two fields of the list of the customers to be modified based on a condition, in my business method. I've got two ways to do this, Using for...each loop, to loop over customers and modify