0

我有这个实体:

public class User
{
     public int Id {get;set;}
     public List<int> Permissions {get;set;}
}

作为一对多的relashionship,我应该为这项工作做些什么?

4

1 回答 1

1

创建一个Permission类型:

public class User
{
     public int Id { get; set; }
     public ICollection<Permission> Permissions { get; set; }
}

public class Permission
{
   public int Id { get; set; }
   public int Value { get; set; }
}
于 2012-11-22T18:13:57.777 回答