1
I’m trying to generate a model-based Migration:
[Key]
public int Id { get; set; }
[MaxLength(100)]
public string NomeInstituicao_Fundamental { get; set; }
public string AnoInicio_Fundamental { get; set; }
public string AnoFim_Fundamental { get; set; }
[MaxLength(100)]
public string NomeInstituicao_Superior { get; set; }
public string AnoInicio_Superior { get; set; }
public string AnoFim_Superior { get; set; }
public Aluno aluno{ get; set; }
Only after executing the command: Add-Migration, is generated my Migration, but the function Up() empty. I need it to come already modeled, equal to the attributes defined in my model.
public partial class AcademicosMig : DbMigration
{
public override void Up()
{
}
public override void Down()
{
}
}
Context:
public class Context : DbContext
{
public Context() : base("name=Default")
{
this.Configuration.LazyLoadingEnabled = false;
this.Configuration.ProxyCreationEnabled = false;
}
public DbSet<Academicos> Academico_ { get; set; }
}
Mine looks like this: public class Context : Dbcontext { public Context() : base("name=Default") { } public virtual Dbset<Academicos> academicos { get; set; } } And yet I still can’t generate migraiton
– user108720