Controller Code Generation Errors

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
dunderfutz
Posts: 4
Joined: Wed 16 Apr 2014 21:12

Controller Code Generation Errors

Post by dunderfutz » Thu 01 May 2014 14:04

I am new to Entity Developer and am trying to use it (v 5.7.331) and the Create Model Wizard (Database First) within VS 2013 to generate the models, controllers and views for a new MVC5/EF6 application against an Oracle 12c database. During the template selection process I am adding the templates for generating controllers and views, which automatically adds the template for generating repositories and units of work. Code generation works fine, but when I build the project immediately after generation, there are multiple errors within each of the generated controllers in the application. The errors are "No overload for method 'All' takes 0 arguments", and references repository.All() in the method code. Example below:

Code: Select all

// GET: /CARRIERs/Details
		
public ViewResult Details(string SITECODE, string CARRIERSCAC
{
	return View(repository.All().Single(x => x.SITECODE == SITECODE && x.CARRIERSCAC == CARRIERSCAC));
}
Not sure if this is a bug or if I am missing something in the generation process?

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Controller Code Generation Errors

Post by Shalex » Fri 02 May 2014 07:53

Please open your *.edml model, navigate to Tools > Entity Developer > Model Explorer > expand the Templates node and set the Generic Repository Pattern property of the RepositoryAndUniotOfWork template to True. Save the model to regenerate the code.

dunderfutz
Posts: 4
Joined: Wed 16 Apr 2014 21:12

Re: Controller Code Generation Errors

Post by dunderfutz » Fri 02 May 2014 16:17

Worked like a champ, thanks!

Post Reply