Return Generics ILIST

      public IList GetTeamcallSummary()
       {
           int currentmonth = DateTime.Today.Month;
           int lastmonth = DateTime.Today.AddMonths(-3).Month;

       
           var calldata = (from c in db.calldetail_viw
               where c.ConnectedDate.Value.Month >= lastmonth
                     && c.ConnectedDate.Value.Month <= currentmonth
                     && c.LocalName == "myaccountrep"
                           group c by new { c.AssignedWorkGroup, month = c.ConnectedDate.Value.Month }
               into g
               select new
               {
                   WorkGroup = g.Key.AssignedWorkGroup,
                   SelectedMonth = g.Key.month,
                   TotalRecords = g.Count()
               });
         

           return calldata.ToList();
       }

Comments

Popular posts from this blog

Linq Exclude from separate list

Sorting Ascending and Descending

Linq Query Syntax vs Method Syntax