public bool DeleteCityById(int empId) { try { using (var repository = new CityRepository()) { return(repository.DeleteById(empId)); } } catch (Exception ex) { //Log exception error _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true); throw new Exception("BusinessLogic:CitysBusiness::DeleteCityById::Error occured.", ex); } }
public async Task <bool> DeleteCityAsync(object Id) { bool result = false; if (Id != null) { City d = await cityRepository.GetAsync(Id); if (d != null) { try { cityRepository.DeleteById(Id); result = true; } catch (Exception ex) { throw ex; } } } return(result); }