When you try to add the following error appears:
Model:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;namespaceMVCEntity.Models{publicclassUsuario{publicintId{get;set;}publicStringLogin{get;set;}publicStringSenha{get;set;}}}
FileDatewhereImaketheDBsettings:
usingSystem.Web;usingMVCEntity.Models;usingSystem.Data.Entity;usingSystem.Data.Entity.ModelConfiguration.Conventions;namespaceMVCEntity.Data{publicclassTestandoMVCContext:DbContext{publicTestandoMVCContext():base("TestandoMVC_Desenv")
{
}
public DbSet<Usuario> Usuario { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
base.OnModelCreating(modelBuilder);
}
}
}
Lines added in my Web.config:
<connectionString>
<add name="TestandoMVC_Desenv" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=E:\Projetos\asp\MVCEntity\MVCEntity\App_Data\TestandoMVC_DB.mdf;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionString>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<system.data>
<DbProviderFactories>
<add name="SqlClient Data Provider"
invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data,
Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</DbProviderFactories>
</system.data>
HELP !!!