0

This is the output of joining 2 tables by inner join.

enter image description here

I want linq query of joing two table as inner join and group by name from one table and sum of total from another table column as taken snapshot as above.pls help

Sai Kumar
  • 31
  • 2
  • 12
  • 1
    Possible duplicate of [LINQ: Using INNER JOIN, Group and SUM](https://stackoverflow.com/questions/530925/linq-using-inner-join-group-and-sum) – Nick Mar 05 '19 at 10:08

1 Answers1

3

Check this post.

var result = (from a in ctx.TableA
             join b in ctx.TableB on a.Id equals b.Id
             group a by a.Name into g
             select new
             {
                Name = g.Key,
                Sum = g.Sum(i => i.Total)
             }).ToList();
Community
  • 1
  • 1
neer
  • 4,031
  • 6
  • 20
  • 34