小编joa*_*ins的帖子

EF 4.3迁移重命名列而不是删除它

我有这门课:

public class HabitDo{
    public int? HabitId { get; set; }
    virtual public Habit Habit { get; set; }

    public int DoId { get; set; }
    virtual public Do Do { get; set; }

    public string Restriction { get; set; }

    public int? ObjectiveId { get; set; }
    public Objective Objective { get; set; }

    public virtual ICollection<DoObjective> Objectives { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

该表很好,但后来我从代码中删除了Objective属性:

 public class HabitDo{
    public int? HabitId { get; set; }
    virtual public Habit Habit { …
Run Code Online (Sandbox Code Playgroud)

sql entity-framework entity-framework-4 ef-code-first ef-migrations

10
推荐指数
1
解决办法
938
查看次数