asif tariq

asif tariq

  • NA
  • 148
  • 17.2k

# linq query mvc

Jan 10 2020 1:28 PM
i want to show data  
 like image
var multable1 = db.Cases.Include("Payer").Where(x => x.CompanyID == comid)
.GroupBy(p => new {p.Payer.PayerName,p.ReceievedDate.Value.Year })
.Select(g => new CompanyUserViewModelforavgpayer
{
PayorName = g.Key.PayerName,
receieveddate = g.Key.Year,
twothousndeighteen =(double)g.Sum(w=>w.TotalCollection),
}).ToList();
 
but my linq query show result
 
 
 
how we show result like first image using linq query 
 

Answers (3)