public ListTaskClientsDTO GetTaskClientAll() { ListTaskClientsDTO listTaskClientsDTO = new ListTaskClientsDTO(); List <TaskClientDTO> listTaskClients = _dbContext.TaskClients.Include(x => x.Client) .Select(c => new TaskClientDTO { Id = c.Id, TaskName = c.TaskName, Description = c.Description, StartTime = c.StartTime, EndTime = c.EndTime, Address = c.Client.Address }).ToList(); listTaskClientsDTO.ListTaskClients = listTaskClients; listTaskClientsDTO.TotalCount = _dbContext.TaskClients.Count(); return(listTaskClientsDTO); }
public IActionResult Get(int id) { ListTaskClientsDTO listTaskClientsDTO = _taskClientService.GetTaskClientById(id); return(Json(Ok(listTaskClientsDTO))); }
public IActionResult Get() { ListTaskClientsDTO listTaskClientsDTO = _taskClientService.GetTaskClientAll(); return(Json(Ok(listTaskClientsDTO))); }