Good morning, I'm making a small solution using ASP.NET MVC with Entity Framework 6 to attend a work from my course. I created the context class:
namespace WillianRibeiro.EstudandoMVC.Web.Data{
public class EstudandoMVCContext : DbContext
{
public EstudandoMVCContext()
:base("EstudandoMVC_Desenv")
{
}
public DbSet<Usuario> Usuario { get; set; }
} }
I created a Model:
namespace WillianRibeiro.EstudandoMVC.Web.Data{
public class EstudandoMVCContext : DbContext
{
public EstudandoMVCContext()
:base("EstudandoMVC_Desenv")
{
}
public DbSet<Usuario> Usuario { get; set; }
}}
I configured web config:
<connectionString>
<add name="EstudandoMVC_Desenv" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=E:\OneDrive\Projetos ASP NET\COPEL\WillianRibeiro.EstudandoMVC\WillianRibeiro.EstudandoMVC.Web\App_Data\EstudandoMVC_BD.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
The problem occurs when I add the controller "User" I am trying to add the MVC 5 controller to the views and using the Entity Framework. I make all the configuration and when I command create of the error: "An error occurred while executing the selected code generator: An exception was thrown by the destination of a call."
I have reviewed the code several times and can not resolve it.