Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Why is System.Web.Http.Validation.IModelValidatorCache is internal?

$
0
0

Hello,

I am introducing a Castle Windsor based IDependencyResolver and registering nearly a dozen or so interfaces with the container.

Now I want to pass some arguments to one of the API actions, and I am running into the issue of System.Web.Http.Validation.IModelValidatorCache.

Which it seems is an INTERNAL interface?! Why in the world is that the case?!

Better question is, what do we do to work around it?

The API is something simple like this:

public IEnumerable<int> Get(int id)
{
    // ...
}

And the request string is this:

const string s = "api/items/-1";

Yes, I want to request an id=-1. It is a contrived example for unit testing purposes, but that is what I want to do.

Edit: Needless to say, after every other interface has been resolved preceding this use case, then I run into an exception unable to resolve theIModelValidatorCache.

Any ideas how to work around it?

Thanks!


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>