2
I created a new project using Asp.Net MVC with EF, and did not configure the connection string property with the same name as the Context class : Dbcontext.
Rodei enable-Migrations -> worked successfully
Rodei add-Migration Nomemigration -> worked right
Rodei update-database -> worked successfully.
But it did not create in the database I had specified in Web.config, and when trying to run the update-database return it is not running pending.
I wanted to understand in this case it saves in which place this information?
This is my Web.config on the connection part.
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="conexao" connectionString="Data Source=localhost;Initial Catalog=bancoDB;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
My Class Context
using System;
namespace AppWeb2.Models
{
public class Mycontext : DbContext
{
//Classes a ser mapeadas
public DbSet<Pessoa> Pessoa { get; set; }
}
}
Put your web project as Startup Project, see if it works.
– MurariAlex
How is your class
Contexto
?– Randrade
I updated the question by adding the Context class.
– JB_