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.)
ED forcing the use of Repository and UOW template?
Re: ED forcing the use of Repository and UOW template?
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.
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.