【发布时间】:2012-12-30 14:55:57
【问题描述】:
使用实体框架,我想定义一个这样的“用户”实体:每个用户有很多朋友,朋友的类型是“用户”。我可以这样定义吗?
public class User
{
public int UserId {get;set;}
public string UserName {get;set;}
public virtual List<User> Friends {get;set;}
}
【问题讨论】:
标签: entity-framework ef-code-first one-to-many