mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 02:29:24 +08:00
统一处理多对多表映射
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user