Following the article http://www.thekip.nl/2011/09/22/using-fluentvalidation-for-both-domain-validation-and-validation-in-mvc-projects/ for me it's not still clear where does the validation appear in application: on client side using ModelState.IsValid? Or it could be used inside a controller?
EDIT
Ok. So for the given example
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(Dinner dinner) {
if(ModelState.IsValid) {
try {
dinner.HostedBy = "SomeUser";
dinnerRepository.Add(dinner);
dinnerRepository.Save();
return RedirectToAction("Details", new {id = dinner.DinnerID });
} catch {
ModelState.AddRuleViolations(dinner.GetRuleViolations());
}
}
return View(dinner);
}
ModelState corresponds to a Dinner entity?
Thanks!