linq foreach c#
sequence.Where(x => x.Name.ToString().Equals("Apple"))
.ToList()
.ForEach( x =>
{
if(someCondition)
{
// Do some stuff here.
}
});
linq foreach c#
sequence.Where(x => x.Name.ToString().Equals("Apple"))
.ToList()
.ForEach( x =>
{
if(someCondition)
{
// Do some stuff here.
}
});
foreach c# linq example
items.ToList().ForEach(i => i.DoStuff());
convert foreach to linq c#
foreach (string field in fieldsList)
{
if (retrievedOrderLine.Attributes.Contains(field))
{
orderLine[field] = retrievedOrderLine[field];
}
}
convert foreach to linq c#
foreach (var customer in customers)
{
customer.Email = !string.IsNullOrEmpty(customer.Name) && !string.IsNullOrEmpty(customer.Last) ? $"{customer.Name}.{customer.Last}{customer.Email.Substring(customer.Email.IndexOf("@"))}" : customer.Email;
}
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