Exemple #1
0
        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());
        }
Exemple #2
0
 public void AddNewSplitHouse(SplitHouse item)
 {
     repository.SplitHouses.DbSet.Add(item);
     repository.SaveChanges();
 }
Exemple #3
0
 public void UpdateSplitHouse(SplitHouse item)
 {
     repository.SplitHouses.DbSet.Update(item);
     repository.SaveChanges();
 }