public ActionResult <List <PayrollDetailResponse> > Get() { var result = payrollDetailService.GetPayrollDetail(); if (result.Count() <= 0) { return(NotFound()); } var response = result.ProjectTo <PayrollDetailResponse>(mapper.ConfigurationProvider).ToList(); return(Ok(response)); }
public PaySlipTemplateDetailResponse Get(int id) { var payrollQ = payrollDetailService.GetPayrollDetail().ToList(); var payrollQCheck = templateMappingService.GetPayrollByTemplateId(id).ToList(); var listparoll = payrollQ.Select(a => new PayrollDetailCheckResponse(a, mapper) { Check = payrollQCheck.Any(p => p.Id == a.Id) ? true : false }).ToList(); var entity = GetAsNoTracking(t => t.Id == id).First(); var result = new PaySlipTemplateDetailResponse(entity, mapper) { ListPayrollDetail = listparoll }; return(result); }