mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-04-03 15:03:25 +08:00
全面修改Id为Guid类型,为2.0版做准备
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenAuth.Domain;
|
||||
using OpenAuth.Domain.Interface;
|
||||
@@ -12,30 +13,30 @@ namespace OpenAuth.Repository
|
||||
return Context.Modules.OrderBy(u => u.Id).Skip((pageindex - 1) * pagesize).Take(pagesize);
|
||||
}
|
||||
|
||||
public int GetRoleCntInOrgs(params int[] orgIds)
|
||||
public int GetRoleCntInOrgs(params Guid[] orgIds)
|
||||
{
|
||||
return LoadInOrgs(orgIds).Count();
|
||||
}
|
||||
|
||||
public int GetModuleCntInOrgs(params int[] orgIds)
|
||||
public int GetModuleCntInOrgs(params Guid[] orgIds)
|
||||
{
|
||||
return LoadInOrgs(orgIds).Count();
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Module> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds)
|
||||
public IEnumerable<Module> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds)
|
||||
{
|
||||
return LoadInOrgs(orgIds).OrderBy(u => u.Id).Skip((pageindex - 1) * pagesize).Take(pagesize);
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
public void Delete(Guid id)
|
||||
{
|
||||
Delete(u =>u.Id == id);
|
||||
}
|
||||
|
||||
public IEnumerable<Module> LoadInOrgs(params int[] orgId)
|
||||
public IEnumerable<Module> LoadInOrgs(params Guid[] orgId)
|
||||
{
|
||||
var result = from role in Context.Modules.Where(u => orgId.Contains(u.ParentId)) select role;
|
||||
var result = from role in Context.Modules.Where(u =>u.ParentId != null && orgId.Contains(u.ParentId.Value)) select role;
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user