public long Add(NotaFiscalAddCommand notaFiscal) { var notaFiscalAdd = Mapper.Map <NotaFiscalAddCommand, NotaFiscal>(notaFiscal); notaFiscalAdd.Destinatario = _destinatarioRepository.GetById(notaFiscal.DestinatarioId); notaFiscalAdd.Transportador = _transportadorRepository.GetById(notaFiscal.TransportadorId); notaFiscalAdd.Emitente = _emitenteRepository.GetById(notaFiscal.EmitenteId); notaFiscalAdd.DataEmissao = notaFiscalAdd.DataEntrada; return(_notaFiscalRepository.Add(notaFiscalAdd).Id); }
public Transportador GetById(long id) { return(_repository.GetById(id)); }