public ResponseAddSplitHouse AddSplitHouse(RequestAddSplitHouse request) { var imagePath = SaveImageToWorksampleDirectory(request.FileName, request.FileData, CATALOG_DIRECTORY); var item = new SplitHouse() { ImageUrl = imagePath, EnergoEfficienty = request.EnergoEfficienty, Model = request.Model, Noise = request.Noise, Power = request.Power, PowerRealty = request.PowerRealty, Price = request.Price, SizeExternal = request.SizeExternal, SizeInternal = request.SizeInternal }; dbManager.AddNewSplitHouse(item); return(new ResponseAddSplitHouse()); }
public void AddNewSplitHouse(SplitHouse item) { repository.SplitHouses.DbSet.Add(item); repository.SaveChanges(); }
public void UpdateSplitHouse(SplitHouse item) { repository.SplitHouses.DbSet.Update(item); repository.SaveChanges(); }