public async Task <ActionResult <int> > Count([FromBody] Table_TableFilterDTO Table_TableFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TableFilter TableFilter = ConvertFilterDTOToFilterEntity(Table_TableFilterDTO); int count = await TableService.Count(TableFilter); return(count); }
public async Task <ActionResult <List <Table_TableDTO> > > List([FromBody] Table_TableFilterDTO Table_TableFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TableFilter TableFilter = ConvertFilterDTOToFilterEntity(Table_TableFilterDTO); List <Table> Tables = await TableService.List(TableFilter); List <Table_TableDTO> Table_TableDTOs = Tables .Select(c => new Table_TableDTO(c)).ToList(); return(Table_TableDTOs); }
private TableFilter ConvertFilterDTOToFilterEntity(Table_TableFilterDTO Table_TableFilterDTO) { TableFilter TableFilter = new TableFilter(); TableFilter.Selects = TableSelect.ALL; TableFilter.Skip = Table_TableFilterDTO.Skip; TableFilter.Take = Table_TableFilterDTO.Take; TableFilter.OrderBy = Table_TableFilterDTO.OrderBy; TableFilter.OrderType = Table_TableFilterDTO.OrderType; TableFilter.Id = Table_TableFilterDTO.Id; TableFilter.Code = Table_TableFilterDTO.Code; TableFilter.OrderId = Table_TableFilterDTO.OrderId; return(TableFilter); }