Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. TransactionDetails
  2. .Join(Transactions, td => td.TransactionId, t => t.Id, (td,t) => new {td,t})
  3. .Join(ProductDetails, ttd => ttd.td.ProductDetailId, pd => pd.Id, (ttd,pd) => new{ttd.td, ttd.t, pd})
  4. .Where(x => x.t.TransactionType == "Sales")
  5. .GroupBy(x => new {x.td.ProductDetailId, x.pd.CostPrice})
  6. .Select(g => new { ProductDetalId = g.Key.ProductDetailId, CostPrice = g.Key.CostPrice, Quantity = g.Sum(a => a.td.Quantity),Total = g.Count()})
  7. .Select(l => new {Net = (l.CostPrice * l.Quantity)})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement