public async Task <IActionResult> Get() { APIResult apiResult; var records = await(await OrderItemService.GetAsync()).ToListAsync(); var result = mapper.Map <List <OrderItemDto> >(records); apiResult = APIResultFactory.Build(true, StatusCodes.Status200OK, ErrorMessageEnum.None, payload: result); return(Ok(apiResult)); }
public async Task <IActionResult> Get() { APIResult apiResult; #region 建立查詢物件 DataRequest dataRequest = new DataRequest() { Skip = 0, Take = 0, Search = "", Sorted = null, }; #endregion var records = await OrderItemService.GetAsync(dataRequest); var result = mapper.Map <List <OrderItemDto> >(records.Result); apiResult = APIResultFactory.Build(true, StatusCodes.Status200OK, ErrorMessageEnum.None, payload: result); return(Ok(apiResult)); }