示例#1
0
        public IActionResult Create(Building building)
        {
            if (!ModelState.IsValid)
            {
                return(View(building));
            }

            _buildingRespository.Add(building);
            return(RedirectToAction(nameof(Index)));
        }
示例#2
0
        public void CreateBuilding(Building building)
        {
            BuildingRepository buildingRepo = new BuildingRepository();

            try
            {
                buildingRepo.Add(building);
                GlobalUnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
 public void AddBuilding(Building item)
 {
     buildingRepository.Add(item);
 }