【发布时间】:2012-03-24 15:26:28
【问题描述】:
我想使用站点角色的操作的用户实体,但点是ExtraAction 实体,操作数据将由ExtraAction 实体过滤,
在ExtraAction 实体中:
如果 Type 属性 == 1 这将是 UNION 到 Action 实体
if Type property == 0 this to be EXCEPT to Action entity
public class User
{
public int Id { get; set; }
public string Email { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public ICollection<SiteRole> SiteRoles { get; set; }
public ICollection<ExtraAction> ExtraActions { get; set; }
}
public class SiteRole
{
public int Id { get; set; }
public string Description { get; set; }
public virtual ICollection<Action> Actions { get; set; }
public virtual ICollection<User> User { get; set; }
}
public class ExtraAction
{
public int Id { get; set; }
public int UserId { get; set; }
public int ActionId { get; set; }
public byte Type { get; set; }
public virtual Action Action { get; set; }
public virtual User User { get; set; }
}
public class Action
{
public int Id { get; set; }
public string Name { get; set; }
public string ActionName { get; set; }
public string ControllerName { get; set; }
public ICollection<SiteRole> SiteRoles { get; set; }
public virtual ICollection<ExtraAction> ExtraActions { get; set; }
}
【问题讨论】:
-
我不明白你想表达什么?你能澄清一下你的实际问题是什么吗?
-
显示你的 linq 语句应该澄清很多。
-
我做到了,但很难解释有点抱歉。
标签: c# .net linq entity-framework entity-framework-4