ED forcing the use of Repository and UOW template?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Thenrich
Posts: 74
Joined: Sun 21 Dec 2014 19:47

ED forcing the use of Repository and UOW template?

Post by Thenrich » Mon 10 Aug 2015 17:58

I am using the latest version of ED v 5.8.x. When creating a new model I select the dbcontext, dto and the two MVC templates. I don't select the repository template. Then I notice in the next screen in the wizard the repository template was still added so I remove it. However the resulting MVC controller(s) have code in them which use the code from the repository template C# code and because that template is not included, my project doesn't compile. Is this by design or a bug? I don't want to to use the repository pattern template.

Entity Framework in itself already implements repository and UOW patterns. I don't want to add another such abstraction layer in my project. (Well.. there are different opinions about this but I should have the choice to use the template or not and in both cases the generated code should compile without errors.)

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: ED forcing the use of Repository and UOW template?

Post by MariiaI » Tue 11 Aug 2015 11:27

The MVC Controller template is tied to the Repository And Unit of Work template (due to this fact this template is added automatically when selecting the MVC Controller template). Thus, the MVC Controller template will not work without the the Repository And Unit of Work template and the code will not be compiled correctly.

You can modify the MVC Controller template so that it suits your needs. For this, right-click the template in the Model Explorer and select "Copy to Model Folder" from the shortcut menu to make it editable (after that the template will be available in your model node in the Solution Explorer), double-click it and make changes you want.

Post Reply