Add new Controller

Asked

Viewed 87 times

0

When adding a new Controller in my project using the option MVC 5 Controller with views, using Entity Framework I’m having the error there was an error running the selected code generator, according to the image.

inserir a descrição da imagem aqui

2 answers

1


In that question seems to be exactly the same problem you found.

The suggestion (which, according to the author of the question, worked for him too) was to add the following setting to the Onmodelcreating:

modelBuilder.Configurations.Add(new OrderConfiguration());

0

Before creating the Controller, make sure that there is no line with something like this in the event OnModelCreating:

modelBuilder.Configurations.Add(new UsuarioConfiguration());
  • Yes there is, so I couldn’t use Fluent API? to map the entities with the EF

  • @Pablovargas You may, but be aware that Scaffolding does not work well with Fluent API.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.