public ArticuloValidation(IArticuloInfrastructure articuloInfrastructure)
        {
            _articuloInfrastructure = articuloInfrastructure;

            RuleFor(x => x.Descripcion).NotEmpty().NotNull().WithMessage("Debe especificar una descripcion.");
            RuleFor(x => x.Descripcion).Must(ExistsDescripcion).WithMessage("La descripcion ingresada ya existe en este lote.");
            RuleFor(x => x.NroSerie).Must(ExistsNroSerie).WithMessage("El numero de serie ya existe.");
            RuleFor(x => x.Precio).Must(MinPrice).WithMessage("El precio debe ser mayor que cero.");
        }
Esempio n. 2
0
 public Lote(ILoteInfrastructure loteInfrastructure, IArticuloInfrastructure articuloInfrastructure,
             IUsuarioInfrastructure usuarioInfrastructure,
             INotificacionesInfrastructure notificacionesInfrastructure)
 {
     _loteInfrastructure           = loteInfrastructure;
     _articuloInfrastructure       = articuloInfrastructure;
     _usuarioInfrastructure        = usuarioInfrastructure;
     _notificacionesInfrastructure = notificacionesInfrastructure;
 }
Esempio n. 3
0
 public Articulo(IArticuloInfrastructure articuloInfrastructure, IUsuarioInfrastructure usuarioInfrastructure)
 {
     _articuloInfrastructure = articuloInfrastructure;
     _usuarioInfrastructure  = usuarioInfrastructure;
 }