统一处理多对多表映射

This commit is contained in:
yubaolee
2015-11-30 11:58:18 +08:00
parent 92ead80909
commit 464f04bb32
36 changed files with 968 additions and 3372 deletions

View File

@@ -17,9 +17,9 @@ namespace OpenAuth.Repository
public IEnumerable<Org> LoadByUser(int userId)
{
var result = from userorg in Context.UserOrgs
join org in Context.Orgs on userorg.OrgId equals org.Id
where userorg.UserId == userId
var result = from userorg in Context.Relevances
join org in Context.Orgs on userorg.SecondId equals org.Id
where userorg.FirstId == userId && userorg.Key =="UserOrg"
select org;
return result;