public async Task <List <ProductMaster_ProductStatusDTO> > SingleListProductStatus([FromBody] ProductMaster_ProductStatusFilterDTO ProductMaster_ProductStatusFilterDTO)
        {
            ProductStatusFilter ProductStatusFilter = new ProductStatusFilter();

            ProductStatusFilter.Skip      = 0;
            ProductStatusFilter.Take      = 20;
            ProductStatusFilter.OrderBy   = ProductStatusOrder.Id;
            ProductStatusFilter.OrderType = OrderType.ASC;
            ProductStatusFilter.Selects   = ProductStatusSelect.ALL;

            ProductStatusFilter.Id = new LongFilter {
                Equal = ProductMaster_ProductStatusFilterDTO.Id
            };
            ProductStatusFilter.Code = new StringFilter {
                StartsWith = ProductMaster_ProductStatusFilterDTO.Code
            };
            ProductStatusFilter.Name = new StringFilter {
                StartsWith = ProductMaster_ProductStatusFilterDTO.Name
            };

            List <ProductStatus> ProductStatuss = await ProductStatusService.List(ProductStatusFilter);

            List <ProductMaster_ProductStatusDTO> ProductMaster_ProductStatusDTOs = ProductStatuss
                                                                                    .Select(x => new ProductMaster_ProductStatusDTO(x)).ToList();

            return(ProductMaster_ProductStatusDTOs);
        }
Exemplo n.º 2
0
        public async Task <List <ProductStatusMaster_ProductStatusDTO> > List([FromBody] ProductStatusMaster_ProductStatusFilterDTO ProductStatusMaster_ProductStatusFilterDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            ProductStatusFilter ProductStatusFilter = ConvertFilterDTOToFilterEntity(ProductStatusMaster_ProductStatusFilterDTO);

            List <ProductStatus> ProductStatuss = await ProductStatusService.List(ProductStatusFilter);

            return(ProductStatuss.Select(c => new ProductStatusMaster_ProductStatusDTO(c)).ToList());
        }