Monday

linq concatenate rows

we can use Aggregate methods to concatenate fields in rows as follow:

var profiles = (from b in invoiceContext.bills
join p in invoiceContext.PaymentProfiles on 1 equals 1
where b.ProfileID == p.Id || b.ProfileType == p.Id
select p.Name).ToList();

if (profiles.Count() > 0)
{
BillingMethodLabel.Text = profiles.Aggregate((current, next) => current + ", " + next);
}


No comments:

make ubuntu business casual

to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...