We've MVC-2 application with Fluent Validation (Visual Studio 2010). Recently we migrated it to Visual Studio 2013, MVC 5. After upgrading the Fluent Validation with NuGet, I get the compilation error for following members.
Can't find namespace FluentValidation.Mvc.MetadataExtensions
I'm using UIHint, DataType, DisplayName members from FluentValidation.Mvc.MetadataExtensions.MetadataExtensions class. Which class should I use to fix errors?
EDIT
Broken code
[FluentValidation.Attributes.Validator(typeof(class1Validator))]
public partial class class1: BusinessBase<decimal>
{
}
public class class1Validator: FluentValidation.AbstractValidator<class1>
{
public class1Validator()
{
RuleFor(o => o.FirstName).NotEmpty().Length(1, 60).UIHint("First Name"); //giving error for UIHint
RuleFor(o => o.Dob).DataType(System.ComponentModel.DataAnnotations.DataType.Date).GreaterThan(DateTime.MinValue).LessThan(DateTime.Now); //giving error for datatype
}
}
public class SearchValidator : FluentValidation.AbstractValidator<SearchCriteria>
{
public SearchValidator()
{
RuleFor(o => o.Id).DisplayName("User ID"); //giving error for DisplayName in both lines
RuleFor(o => o.LastName).DisplayName("Last Name");
}
}
FluentValidation.Mvc.dll, v2.0.50727assembly. I checked in VS 2010. In VS 2013 I added reference toFluentValidation.Mvc.dll, but didnt help