Exemplo n.º 1
0
        public IActionResult DeleteConfirm(int id)
        {
            var building = _buildingRepostiory.GetBuildingWithId(id);

            _buildingRepostiory.DeleteBuilding(building);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> DeleteBuilding(int id)
        {
            if (await _buildingRepository.GetBuilding(id) is Domain.Models.Building building)
            {
                await _buildingRepository.DeleteBuilding(id);

                return(Ok());
            }
            return(NotFound());
        }