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); }
public static WareHouseItem ToItem(this WareHouse entity) { return(entity.MapTo <WareHouse, WareHouseItem>()); }
public static WareHouse ToWareHouse(this WareHouse entity, WareHouse destination) { return(entity.MapTo(destination)); }
public static WareHouseModel ToModel(this WareHouse entity) { return(entity.MapTo <WareHouse, WareHouseModel>()); }