jgauffin / griffin.mvccontrib

A contribution project for ASP.NET MVC3
http://blog.gauffin.org/tag/griffin-mvccontrib/
GNU Lesser General Public License v3.0
83 stars 40 forks source link

No constructor for LocalizedModelValidatorProvider takes 1 argument #49

Open danielbsig opened 10 years ago

danielbsig commented 10 years ago

According to the example code in the article at CodeProject, you should initialize the library like this:

var stringProvider = 
    new ResourceStringProvider(Resources.LocalizedStrings.ResourceManager);
ModelMetadataProviders.Current = new LocalizedModelMetadataProvider(stringProvider);
ModelValidatorProviders.Providers.Clear();
ModelValidatorProviders.Providers.Add(
    new LocalizedModelValidatorProvider(stringProvider));

However, using the latest version of the library, I get a compiler error on the last line, because the class LocalizedModelValidatorProvider has only a parameterless constructor.

Is the sample code out of date?