result = (from invoice in invoices join invoiceItem in invItems on invoice.Id equals invoiceItem.InvoiceId orderby invoice.InvoiceNo select new InvoiceReceiveShipmentVM { dtInvoiced = invoice.dtInvoiced, InvoiceNumber = invoice.InvoiceNo, InvoiceType = invoice.InvoiceType, InvoiceStatus = invoice.InvoiceStatus, Lines = invoiceItem.Line, Total = invoice.Total, Carrier = invoice.Carrier, }); return result.Distinct().AsQueryable();
public static IEnumerable DistinctBy(this IEnumerable list, Func<t, object> propertySelector) { return list.GroupBy(propertySelector).Select(x => x.First()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)