I am using asp.net mvc controller with constructor injected service IMyService. MyService (implements IMyService) uses some contextual information in its constructor. This contextual information supplied from different third party web site. Contextual information is required for creating MyService instance.
Controller's action filter uses some logic in order to determine, if this contextual information is available. If not, then request is redirected to another web site. The problem is, that controller constructor is called by IoC container before controller's filter. As a result MyService throws exception if contextual information is not provided.
How to workaround this situation?
UPD:
It seems that DelegatingHandler is a way to go.