title: MVC’s DefaultModelBinder does not Validate The Object
body: <p>I'm using FluentValidation MVC5 for validating the object. I've followed this <a href="http://fluentvalidation.codeplex.com/wikipage?title=mvc&amp;referringTitle=Documentation" rel="nofollow">tutorial</a>. When I post the form, why MVC DefaultModelBinder does not validate the object? FluentValidationModelValidatorProvider is already configured in global.asax</p>
  
  <p>Global.asax</p>
  
  <pre><code>protected void Application_Start()
  {
      FluentValidationModelValidatorProvider.Configure();
  }
  </code></pre>
  
  <p>ClientValidationEnabled and UnobtrusiveJavaScriptEnabled is set true in web.config.
  I've also downloaded latest jquery.validation package, add to BundleConfig, and in its view (Create.cshtml) I've added</p>
  
  <pre><code>@section Scripts {
      @Scripts.Render("~/bundles/jqueryval")
  }
  </code></pre>
  
  <p>CurrencyViewModel.cs</p>
  
  <pre><code>[Validator(typeof(CurrencyViewModelValidator))]
  public class CurrencyViewModel
  {
      public int CurrencyID { get; set; }
      public string Code { get; set; }
      public string Name { get; set; }
  }
  
  public class CurrencyViewModelValidator : AbstractValidator&lt;CurrencyViewModel&gt;
  {
      public CurrencyViewModelValidator()
      {
          RuleFor(x =&gt; x.Code).Length(3);
          RuleFor(x =&gt; x.Name).Length(3, 50);
      }
  }
  </code></pre>
  
  <p>CurrencyController.cs</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Create(CurrencyViewModel currencyVM)
  {
      if (ModelState.IsValid)
      {
          Currency currency = new Currency()
          {
              Code = currencyVM.Code,
              Name = currencyVM.Name
          };
  
          db.Currencies.Add(currency);
          db.SaveChanges();
  
          return RedirectToAction("Index");
      }
  
      return View(currencyVM);
  }
  </code></pre>