0

My service base class has generic public property

public IProvider<TRequest, TResponse> Provider;

which I am trying to inject with

container.Register<IProvider<GetAccount, GetAccountResponse>>(c => new AccountProvider());

but that does not work (property is null) while other non-generic properties are initialized.

Should it (can I make it) work?

Stan Bashtavenko
  • 1,025
  • 11
  • 16

1 Answers1

2

This is a public field:

public IProvider<TRequest, TResponse> Provider;

Add a getter/setter to make it a public property:

public IProvider<TRequest, TResponse> Provider { get; set; }

Which Funq does support.

mythz
  • 141,670
  • 29
  • 246
  • 390