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 from list c#
// Single
string search = "testSearch";
List<string> list = new List<string>(); // Need to create a string list
string result = list.Single(s => s == search);
// Find all where meets the criteria
IEnumerable<string> results = list.Where(s => s == search);
// Select first one
string result = list.First(s => s == search);
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