public async Task <RegistroEntradaOutput> GetRegistroEntradaProductoById(int idRegistro)
        {
            RegistroEntradaProducto registroEntradaProducto = await _registroEntradaProductoRepository.GetRegistroEntradaProductoById(idRegistro);

            RegistroEntradaOutput registroEntradaOutput = _mapper.Map <RegistroEntradaOutput>(registroEntradaProducto);

            return(registroEntradaOutput);
        }
        public async Task EliminarRegistroEntradaProductoAsync(int idRegistro)
        {
            RegistroEntradaProducto registroEntrada = new RegistroEntradaProducto()
            {
                Codigo = idRegistro
            };

            _db.Entry(registroEntrada).State = EntityState.Deleted;
        }
        public async Task AgregarEditarRegistroEntradaProductoAsync(RegistroEntradaInput registroEntrada)
        {
            if (registroEntrada.Codigo.GetValueOrDefault(0) > 0)
            {
                RegistroEntradaProducto registroEntrada1 = await _registroEntradaProductoRepository.GetRegistroEntradaProductoById(registroEntrada.Codigo.Value, trackear : true);

                _mapper.Map <RegistroEntradaInput, RegistroEntradaProducto>(registroEntrada, registroEntrada1);
            }
            else
            {
                RegistroEntradaProducto registro = _mapper.Map <RegistroEntradaProducto>(registroEntrada);
                await _registroEntradaProductoRepository.AgregarEditarRegistroEntradaProductoAsync(registro);
            }
            await _registroEntradaProductoRepository.SaveChangesAsync();
        }
 public async Task AgregarEditarRegistroEntradaProductoAsync(RegistroEntradaProducto registroEntradaProducto)
 {
     await _db.RegistroEntradaProducto.AddAsync(registroEntradaProducto);
 }