public Task GuardarAsync(DocumentoDePago documentoDePago)
        {
            _context.Entry(documentoDePago.ClienteMayorista).State = EntityState.Unchanged;
            _context.Entry(documentoDePago.Encargado).State        = EntityState.Unchanged;
            documentoDePago.Pagos.Where(x => x.TipoPago == TipoPago.Deposito).ToList().ForEach(x => _context.Entry(x.CuentaBancaria).State = EntityState.Unchanged);

            _context.DocumentoDePago.Add(documentoDePago);
            return(_context.SaveChangesAsync());
        }
        public Task ActualizarAsync(DocumentoDePago documentoDePago)
        {
            _context.Entry(documentoDePago.Sucursal).State             = EntityState.Unchanged;
            _context.Entry(documentoDePago.ClienteMayorista).State     = EntityState.Unchanged;
            _context.Entry(documentoDePago.Encargado).State            = EntityState.Unchanged;
            documentoDePago.Pagos.ForEach(x => _context.Entry(x).State = EntityState.Unchanged);

            _context.Entry(documentoDePago).State = EntityState.Modified;
            return(_context.SaveChangesAsync());
        }
        public static Task GuardarAsync(TipoBase tipoBase, DocumentoDePago documentoDePago)
        {
            IDocumentoDePagoRepository documentoDePagoRepository = new DocumentoDePagoRepository(new VentaContext(tipoBase));

            return(documentoDePagoRepository.GuardarAsync(documentoDePago));
        }