Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where to set the ModelMetadataProviders? #18

Open
maranganator opened this issue Feb 9, 2012 · 2 comments
Open

where to set the ModelMetadataProviders? #18

maranganator opened this issue Feb 9, 2012 · 2 comments

Comments

@maranganator
Copy link

where do i set the ModelMetadataProviders.Current = new CustomModelMetadataProvider();
I cannot do this "locator.Register<ModelMetadataProvider, CustomModelMetadataProvider>();" as it gives me this execption "An instance of ModelMetadataProvider was found in the resolver as well as a custom registered provider in ModelMetadataProviders.Current. Please set only one or the other.". I try overrieding the StartUp() method but nothing happen also.

@darrencauthon
Copy link
Contributor

Have you tried registering your CustomModelMetadataProvider with the IoC container?

@maranganator
Copy link
Author

I try registering it in ServiceRegistration but locator.Register<- IMovieService, MovieService-> (); but this exception is thrown "An instance of ModelMetadataProvider was found in the resolver as well as a custom registered provider in ModelMetadataProviders.Current. Please set only one or the other." But i have not set the ModelMetadataProviders.Current anywhere in my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants