MvcExtensions/Core — pull request #2 by AlexBar (2012-06-10 21:02:18+00:00)
Title: Implemented Remote validation support for MvcExtensions

Hi,

I've implemented Remote validation support. Available methods:

Route based configuration:
.Remote(c => c.For("routeName"));
.Remote(c => c.For("routeName", new[] { "Id", "Id2" }));

Configuration via string-based methods:
.Remote(c => c.For(controller, action));
.Remote(c => c.For(controller, action, areaName));
.Remote(c => c.For(controller, action, new[]{additionalFields}));
.Remote(c => c.For(controller, action, new[] { additionalField1, additionalField2 }));
.Remote(c => c.For(controller, action, areaName, new[] { additionalFields }));

Configuration via strong-typed methods:
.Remote(c => c.For(a => a.CheckUsername2(null, null))); // additional fields will automatically parsed from controller action method
.Remote(c => c.For(a => a.CheckUsername2(null, null), "area"));
.Remote(c => c.For(a => a.CheckUsername2(null, null), new[] { additionalField1, additionalField2 }));
.Remote(c => c.For(a => a.CheckUsername2(null, null), "area", new[] { additionalField1, additionalField2 }));
Simplified version when no any additional fields needed:
.Remote(c => c.For(x => x.CheckUsername1));
.Remote(c => c.For(x => x.CheckUsername1, areaName));

To set http method use:
.Remote(c => c.HttpMethod(httpMethod).For(x => x.CheckUsername1));