public async Task <IList <DepartmentWiseEmployeeStatisticsVM> > GetDepartmertStat()
        {
            var employee = _context.Set <Employee>().ToList();
            var t        = from dept in _innerDB.ToList()
                           join emp in employee on dept.Id equals emp.Department.Id
                           select new { dept.Id, dept.Name } into x
            group x by new { x.Id, x.Name } into g
                    select new DepartmentWiseEmployeeStatisticsVM
            {
                Total          = g.Count(),
                DepartmentName = g.Key.Name,
                //Time = g.Sum(i => i.Zeit)
            };

            return(await Task.FromResult(t.ToList()));// await t.ToList();
        }
Example #2
0
 internal BaseRepository(OfficeAttendenceSystemDbContext DbContext)
 {
     _DbContext = DbContext;
     _innerDB   = _DbContext.Set <TEntity>();
 }