linq where in list
var allowedStatus = new[]{ "A", "B", "C" };
var filteredOrders = orders.Order.Where(o => allowedStatus.Contains(o.StatusCode));
linq where in list
var allowedStatus = new[]{ "A", "B", "C" };
var filteredOrders = orders.Order.Where(o => allowedStatus.Contains(o.StatusCode));
linq where
// The LINQ Where can be used to filter in a collection.
// It will return a Enumerable that contains all of the matching elements
var names = new List<string>() {"John", "Jane", "William"};
//I use ToLower to get any name that contains a J, Capital or not.
var namesWithJ = names.Where(n => n.ToLower().Contains("j"));
//Returns IEnumerable<string> that contains ["John", "Jane"]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us