public int Delete(int id) { try { return(_addressRepo.DeleteById(id)); } catch (Exception e) { throw new Exception(e.Message); } }
public bool DeleteBuildingAdress(int addressId, int buildingId) { var count = _addressRepo.CountAddresses(buildingId); if (count > 1) { return(_addressRepo.DeleteById(addressId)); } else { return(false); } }