Exemple #1
0
        public async Task <Building> SaveBuilding(BuildingDataDto building)
        {
            var bldg = await _buildingsRepo.GetFirstOrDefault(b => b.Id == building.Id);

            if (bldg != null)
            {
                bldg.Name               = building.Name;
                bldg.Number             = building.Number;
                bldg.BuildingCategoryId = building.BuildingCategoryId;
                bldg.Sector             = (building.Sector != null) ? building.Sector : "";
            }

            await _buildingsRepo.SaveAsync();

            return(bldg);
        }
Exemple #2
0
        public async Task <IActionResult> SaveBuilding([FromBody] BuildingDataDto building)
        {
            var bldg = await _buildingService.SaveBuilding(building);

            return(Ok());
        }