Skip to content

ChessOK/ModelFramework.Mvc

Repository files navigation

Getting Started

ModelFramework.Mvc contains ASP.NET MVC 3-4 extensions for ModelFramework:

  • ModelController
  • AutoFac modules that support ASP.NET autoloading feature
  • Tools for ViewModels

Installation

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).

Usage

ModelController

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);
    }
}

Autoloading modules

TBD. See automatically-created class WebModule in your project for example.

View models

TBD.

About

ASP.NET MVC extensions for ModelFramework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •