Primeiro apresentou o seguinte erro:
The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and t
ry again.
At line:1 char:14
+ Add-Migration <<<< criaUsuario
+ CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Depois entrei no link do stack overflow http://stackoverflow.com/questions/10411529/package-manager-console-enable-migrations-commandnotfoundexception-only-in-a-spe
recomendando usar o comando abaixo para instalar o prerelease: Install-Package EntityFramework -IncludePrerelease
Agora quando tento dar o comando Add-Migration, vem o seguinte erro: No migrations configuration type was found in the assembly 'lojaComEntity'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
Eu tento dar o comando Enable-Migrations e vem o seguinte erro: No context type was found in the assembly 'lojaComEntity'.
Obs.: Eu criei a classe do context Type da seguinte forma:
using lojaComEntity.Entidades;
using Microsoft.Data.Entity;
using System.Configuration;
namespace lojaComEntity
{
public class EntidadesContext : DbContext
{
public DbSet<Usuario> Usuarios { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
string stringConexao = ConfigurationManager.ConnectionStrings["lojaConnectionString"].ConnectionString;
optionsBuilder.UseSqlServer(stringConexao);
base.OnConfiguring(optionsBuilder);
}
}
}
Poderiam me ajudar por gentileza? Muito obrigado.