ModelFramework.Mvc contains ASP.NET MVC 3-4 extensions for ModelFramework:
- ModelController
- AutoFac modules that support ASP.NET autoloading feature
- Tools for ViewModels
ModelFramework.Mvc is available as a NuGet Package. To install it, open your Package Manager Console and type:
PM> Install-Package ModelFramework.Mvc
It will install all dependencies, including AutoFac, register AutoFac
as default Dependency Resolver and set request-based lifetime for ModelContext
(see MvcModule.cs).
TBD.
public class UserController : ModelController
{
    [HttpPost]
    public ActionResult Register(RegisterModel model)
    {
        if (Bus.TrySend<RegisterCommand>(x => x.Data = model))
        {
            return RedirectToAction("Index", "Home");
        }
        return View(model);
    }
}TBD. See automatically-created class WebModule in your project for example.
TBD.