コード例 #1
0
        public async Task <ActionResult <PublicApi.v1.DTO.ShipperWithOrderCount> > GetShipper(int id)
        {
            var shipper = await _bll.Shippers.FindByIdAsyncDTO(id);

            if (shipper == null)
            {
                return(NotFound());
            }

            return(ShipperMapper.MapFromBLL(shipper));
        }
コード例 #2
0
        public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.ShipperWithOrderCount> > > GetShippers(string search, int?pageIndex, int?pageSize)
        {
            if ((pageIndex != null && pageIndex < 1) || (pageSize != null && pageSize < 1))
            {
                return(BadRequest());
            }
            var shipper = (await _bll.Shippers.GetAllWithOrdersCountByShopAsync(User.GetShopId(), search, pageIndex, pageSize)).Select(e => ShipperMapper.MapFromBLL(e)).ToList();

            return(shipper);
        }