0
When trying to add the following error appears:
Model:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MVCEntity.Models
{
public class Usuario
{
public int Id { get; set; }
public String Login { get; set; }
public String Senha { get; set; }
}
}
Data file where I do DB settings:
using System.Web;
using MVCEntity.Models;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
namespace MVCEntity.Data
{
public class TestandoMVCContext : DbContext
{
public TestandoMVCContext() : base ("TestandoMVC_Desenv")
{
}
public DbSet<Usuario> Usuario { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
base.OnModelCreating(modelBuilder);
}
}
}
Lines added to 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!!!