public async Task <List <ShippingAddressDetail_WardDTO> > SingleListWard([FromBody] ShippingAddressDetail_WardFilterDTO ShippingAddressDetail_WardFilterDTO)
        {
            WardFilter WardFilter = new WardFilter();

            WardFilter.Skip      = 0;
            WardFilter.Take      = 20;
            WardFilter.OrderBy   = WardOrder.Id;
            WardFilter.OrderType = OrderType.ASC;
            WardFilter.Selects   = WardSelect.ALL;

            WardFilter.Id = new LongFilter {
                Equal = ShippingAddressDetail_WardFilterDTO.Id
            };
            WardFilter.Name = new StringFilter {
                StartsWith = ShippingAddressDetail_WardFilterDTO.Name
            };
            WardFilter.OrderNumber = new LongFilter {
                Equal = ShippingAddressDetail_WardFilterDTO.OrderNumber
            };
            WardFilter.DistrictId = new LongFilter {
                Equal = ShippingAddressDetail_WardFilterDTO.DistrictId
            };

            List <Ward> Wards = await WardService.List(WardFilter);

            List <ShippingAddressDetail_WardDTO> ShippingAddressDetail_WardDTOs = Wards
                                                                                  .Select(x => new ShippingAddressDetail_WardDTO(x)).ToList();

            return(ShippingAddressDetail_WardDTOs);
        }
Esempio n. 2
0
        public async Task <List <WardMaster_WardDTO> > List([FromBody] WardMaster_WardFilterDTO WardMaster_WardFilterDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            WardFilter WardFilter = ConvertFilterDTOToFilterEntity(WardMaster_WardFilterDTO);

            List <Ward> Wards = await WardService.List(WardFilter);

            return(Wards.Select(c => new WardMaster_WardDTO(c)).ToList());
        }