public async Task<ActionResult> Index(int page = 1, int pageSize = 10) { if (page < 1) page = 1; var notices = await _noticesService.FetchAsync(); notices = notices.Where(x => x.Active); notices = notices.GetOrdered().ToList(); return Ok(notices.GetPagedList(_mapper, page, pageSize)); }
public async Task <ActionResult> Index(int open, int active, int page = 1, int pageSize = 10) { if (page < 1) { page = 1; } // 1 = public 公開, 0 = 私人 var notices = await _noticesService.FetchAsync(open.ToBoolean()); notices = notices.Where(x => x.Active == active.ToBoolean()); notices = notices.GetOrdered().ToList(); return(Ok(notices.GetPagedList(_mapper, page, pageSize))); }