EF 报【序列包含一个以上的元素】解决办法

1.检查模型是否存在重复的字段,eg:

public class AggregateRoot

{

    public System.Guid Guid { get; set; }

}

public partial class User : AggregateRoot
{
public int ID { get; set; }

//在父类已经定义了Guid,子类又重新定义,故报此错误,元素重复
public System.Guid Guid { get; set; }
public int DepId { get; set; }
public string Name { get; set; }
public string Pwd { get; set; }
public bool Gender { get; set; }
public string Post { get; set; }
public string Address { get; set; }
public bool IsDel { get; set; }
public System.DateTime AddTime { get; set; }
public System.DateTime UpdateTime { get; set; }
}

posted @ 2015-04-12 21:55  Pirate_Q  阅读(3669)  评论(0编辑  收藏  举报