public Period Delete(long id) { var period = _periodsRepository.Delete(id); if (period == null) { throw new NotFoundException("No se encontro el periodo"); } _periodsRepository.Save(); return(period); }
public async Task DeletePeriod(int periodId) { var periodToDelete = await _periodRepository.FindByIdAsync(periodId); if (periodToDelete == null) { throw new EntityNotFoundException($"Periode met ID {periodId} werd niet gevonden."); } _periodRepository.Delete(periodToDelete); await _periodRepository.SaveChangesAsync(); }
public void Delete(PeriodId periodId) { try { using (var scope = new TransactionScope()) { var period = periodRep.GetById(periodId); periodRep.Delete(period); scope.Complete(); } } catch (Exception exp) { var res = periodRep.TryConvertException(exp); if (res == null) { throw; } throw res; } }
public Period Delete(int id) { return(_periodRepository.Delete(id)); }