New answers tagged

1

If you want to reduce the iteration to get the value for ColumnC and ColumnD and make the code cleaner, you can try using Aggregate instead. var output = input .GroupBy(d => new {d.ColumnA, d.ColumnB}) .Select( g => g.Aggregate( new MappingClass {ColumnA = g.Key.ColumnA, ColumnB = g.Key....


1

I can see at least two places where you can make your code more concise. PaymentType As you have suspected replacing multiple x.PaymentType == PaymentMethod.XYZ || statements with a collection lookup might help. With this approach you separate data from operation. Before var paymentAuto = paymentOptionList .First(x => x.PaymentType == PaymentMethod....


Top 50 recent answers are included