2
Good morning, I am making a small solution using ASP.NET MVC with Entity Framework 6 to meet a work of my course. I believe 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 the Model:
namespace WillianRibeiro.EstudandoMVC.Web.Data{
public class EstudandoMVCContext : DbContext
{
public EstudandoMVCContext()
:base("EstudandoMVC_Desenv")
{
}
public DbSet<Usuario> Usuario { get; set; }
}}
I set up the 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 "User" controller I am trying to add the MVC 5 controller with the views and using the Entity Framework. I do all the configuration and when I have created the error: "Error executing selected code generator: An exception was triggered by the destination of a call".
I’ve gone over the code several times and I can’t solve it.
What is the Innerexception?
– Leandro Angelo