码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-04-12 22:42:48      阅读:1450      评论:0      收藏:0      [点我收藏+]

标签:

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; }
}

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

标签:

原文地址:http://www.cnblogs.com/pari-Zhong/p/4420783.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!