问题
EF migration shows empty Up() Down() methods _migrationhistory created in database but no tables has been created
code for creating model
Public partial class Student:BaseEntity
{
public string name { get; set; }
public string collegeName { get; set; }
public int numberOfBooks { get; set; }
}
code for model mapping
public partial class StudentMap: EntityTypeConfiguration<Student>
{
public StudentMap()
{
this.ToTable("Students");
this.HasKey(c => c.Id);
this.Property(c => c.name);
this.Property(c => c.collegeName);
this.Property(c => c.numberOfBooks);
}
}
code for dbcontext
public class CROObjectContext: DbContext
{
public CROObjectContext() : base("pro-nopCommerce")
{
}
public virtual DbSet<Student> students { get; set; }
}
来源:https://stackoverflow.com/questions/36359799/ef-migration-shows-empty-up-down-methods-no-tables-created-in-database