Ejemplo n.º 1
0
        public void CreateOrUpdateStocking_Test()
        {
            Goods goods = new Goods {
                Id = 11, GoodsName = "水杯", GoodsManufacturer = "as", GoodsModel = "wu", GoodsProuductionDate = new DateTime()
            };

            UsingDbContext(context =>
            {
                context.Goods.Add(goods);
            });


            StockingEditDto dto = new StockingEditDto {
                Id = 1, StockingNumber = 21, Goods = goods
            };

            // // Act
            _stockingAppService.CreateOrUpdateStockingAsync(new CreateOrUpdateStockingInput {
                StockingEditDto = dto
            });

            //var res = _stockingAppService.GetStockingByIdAsync(1);



            Assert.True(true);
        }
Ejemplo n.º 2
0
        protected async Task UpdateStockingAsync(StockingEditDto input)
        {
            //TODO 能不能获取到 goods呢?
            Stocking entity = await _stockingRepository.GetAsync(input.Id.Value);

            await _stockingRepository.UpdateAsync(input.MapTo(entity));
        }
Ejemplo n.º 3
0
 protected async Task CreateStockingAsync(StockingEditDto input)
 {
     var entity = input.MapTo <Stocking>();
     await _stockingRepository.InsertAsync(entity);
 }