Instructions on how to use EntityUi

Here are the basic, general steps on how to use EntityUi for a new project:

1. Start a blank MVC project, and then add 2 Class Library Projects to the Solution, one for Domain Model, and the other for Repository.

2. Then add EntityUi from nuget to the Domain Project and Repository Project in the solution using the command “Install-Package EntityUi”.

3. Next add EntityUi.Web from nuget to the blank MVC Project, using the command “Install-Package EntityUi.Web”.

4. Add your Domain Model inheriting from DomainModelBase, your Data Context class and Repository Classes inheriting from RepositoryBase, and View Model classes inheriting from ViewModelBase.

5. Add your Controller, delete the default index method and just inherit it from “ControllerBase”.

6. Finally, write the mapping setup between the Domain and View Model objects in global.aspx.

You should be able to run your application after these steps. For complete details, see this Code Project article.

EntityUi added to Nuget

I have posted EntityUi as a library on Nuget.

To install EntityUi, run the following command in the Package Manager Console

PM> Install-Package EntityUi

Here is a link to the Nuget Package: https://www.nuget.org/packages/EntityUi/

The EntityUi package has the following core concepts:

  • DomainModelBase – Base class that your Domain Model objects need to inherit from.
  • ViewModelBase – Base class that your View Model objects need to inherit from.
  • ControllerBase – Base class for your Controller, it provides Crud methods built in.
  • RepositoryBase – Base class for your Repository, it provides Crud methods built in using Entity Framework.

I also wrote and uploaded a detailed article on how to use EntityUi on CodeProject. Here is the link:

http://www.codeproject.com/Articles/743114/EntityUI-Automatic-UI-Generator

There are a few files that are required in the MVC project for all of this to work properly. These files really are a core part of EntityUi. I will add this as a nuget package eventually, but for now, it’s available in the zipped file download in this article.