예제 #1
0
        public async Task <WareHouseServiceModel> CreateAsync(string name, string companyId)
        {
            var warehouse = new WareHouse()
            {
                Name = name,
            };

            await this.companyService.SetCompanyAsync(warehouse, companyId);

            if (warehouse.Company == null)
            {
                return(null);
            }

            this.dbContext.Update(warehouse.Company);
            await this.dbContext.SaveChangesAsync();

            var result = warehouse.MapTo <WareHouseServiceModel>();

            return(result);
        }
예제 #2
0
 public static WareHouseItem ToItem(this WareHouse entity)
 {
     return(entity.MapTo <WareHouse, WareHouseItem>());
 }
예제 #3
0
 public static WareHouse ToWareHouse(this WareHouse entity, WareHouse destination)
 {
     return(entity.MapTo(destination));
 }
예제 #4
0
 public static WareHouseModel ToModel(this WareHouse entity)
 {
     return(entity.MapTo <WareHouse, WareHouseModel>());
 }