public IActionResult DeleteConfirm(int id) { var building = _buildingRepostiory.GetBuildingWithId(id); _buildingRepostiory.DeleteBuilding(building); return(RedirectToAction("Index")); }
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()); }