public IActionResult Create(Building building) { if (!ModelState.IsValid) { return(View(building)); } _buildingRespository.Add(building); return(RedirectToAction(nameof(Index))); }
public void CreateBuilding(Building building) { BuildingRepository buildingRepo = new BuildingRepository(); try { buildingRepo.Add(building); GlobalUnitOfWork.Commit(); } catch (Exception ex) { throw ex; } }
public void AddBuilding(Building item) { buildingRepository.Add(item); }