Пример #1
0
        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);
        }
Пример #2
0
        public IActionResult Get(int id)
        {
            ListTaskClientsDTO listTaskClientsDTO = _taskClientService.GetTaskClientById(id);

            return(Json(Ok(listTaskClientsDTO)));
        }
Пример #3
0
        public IActionResult Get()
        {
            ListTaskClientsDTO listTaskClientsDTO = _taskClientService.GetTaskClientAll();

            return(Json(Ok(listTaskClientsDTO)));
        }