public async Task <ActionResult <int> > Count([FromBody] Notificaiton_NotificaitonFilterDTO Notificaiton_NotificaitonFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } NotificaitonFilter NotificaitonFilter = ConvertFilterDTOToFilterEntity(Notificaiton_NotificaitonFilterDTO); int count = await NotificaitonService.Count(NotificaitonFilter); return(count); }
private NotificaitonFilter ConvertFilterDTOToFilterEntity(Notificaiton_NotificaitonFilterDTO Notificaiton_NotificaitonFilterDTO) { NotificaitonFilter NotificaitonFilter = new NotificaitonFilter(); NotificaitonFilter.Selects = NotificaitonSelect.ALL; NotificaitonFilter.Skip = Notificaiton_NotificaitonFilterDTO.Skip; NotificaitonFilter.Take = Notificaiton_NotificaitonFilterDTO.Take; NotificaitonFilter.OrderBy = Notificaiton_NotificaitonFilterDTO.OrderBy; NotificaitonFilter.OrderType = Notificaiton_NotificaitonFilterDTO.OrderType; NotificaitonFilter.Id = Notificaiton_NotificaitonFilterDTO.Id; NotificaitonFilter.AccountId = Notificaiton_NotificaitonFilterDTO.AccountId; NotificaitonFilter.Content = Notificaiton_NotificaitonFilterDTO.Content; NotificaitonFilter.Time = Notificaiton_NotificaitonFilterDTO.Time; return(NotificaitonFilter); }
public async Task <ActionResult <List <Notificaiton_NotificaitonDTO> > > List([FromBody] Notificaiton_NotificaitonFilterDTO Notificaiton_NotificaitonFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } NotificaitonFilter NotificaitonFilter = ConvertFilterDTOToFilterEntity(Notificaiton_NotificaitonFilterDTO); List <Notificaiton> Notificaitons = await NotificaitonService.List(NotificaitonFilter); List <Notificaiton_NotificaitonDTO> Notificaiton_NotificaitonDTOs = Notificaitons .Select(c => new Notificaiton_NotificaitonDTO(c)).ToList(); return(Notificaiton_NotificaitonDTOs); }