public async Task InsertFinancialSizing(FinancialSizingDTO newFinancialSizing) { FinancialSizing dbRecord = _mapper.Map <FinancialSizing>(newFinancialSizing); await _unitOfWork.FinancialSizingRepository.Add(dbRecord); await _unitOfWork.SaveAdministrationSwitchChangesAsync(); }
public async Task <FinancialSizingDTO> GetFinancialSizing(int id) { FinancialSizing dbRecord = await _unitOfWork.FinancialSizingRepository.GetById(id); FinancialSizingDTO result = _mapper.Map <FinancialSizingDTO>(dbRecord); return(result); }
private async Task CheckFinancialSizingValue(ChannelDTO newChannel) { if (newChannel.FinancialSizingID.HasValue) { FinancialSizing financialSizing = await _unitOfWork.FinancialSizingRepository.GetById(newChannel.FinancialSizingID.Value); if (financialSizing == null) { throw new ValidationException("No existe registro para el Dimensionamiento Financiero proporcionado."); } } }
public async Task <bool> UpdateFinancialSizing(FinancialSizingDTO updatedFinancialSizingDTO) { FinancialSizing existingRecord = await _unitOfWork.FinancialSizingRepository.GetById(updatedFinancialSizingDTO.Id); if (existingRecord == null) { throw new ValidationException("Registro no existe para el ID proporcionado."); } var updatedRecord = _mapper.Map <FinancialSizing>(updatedFinancialSizingDTO); _unitOfWork.FinancialSizingRepository.Update(existingRecord, updatedRecord); await _unitOfWork.SaveAdministrationSwitchChangesAsync(); return(true); }