locked
Unity - Inject array RRS feed

  • Question

  • User1532676058 posted

    Hi,

    I have the following in the config file...

    container.RegisterType<ProductInstanceValidatorBase, CartItemStockValidator>();
    container.RegisterType<ProductInstanceValidatorBase, MonthlyCartItemValidator>();
    container.RegisterType<CartValidator>();

    ..constructor like so...

     public CartValidator(ProductInstanceValidatorBase[] validators)
     {
       this.validators = validators;
     }

    ...I call the following but the array is empty...

    container.Resolve(typeof(CartValidator));

    Any ideas?

    Cheers, WT.

     

     

    Monday, August 9, 2010 7:26 PM

Answers