mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 02:29:24 +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;
|
||||
@@ -13,25 +14,25 @@ namespace OpenAuth.Repository
|
||||
return Context.Stocks.OrderBy(u => u.Id).Skip((pageindex - 1) * pagesize).Take(pagesize);
|
||||
}
|
||||
|
||||
public IEnumerable<Stock> LoadInOrgs(params int[] orgId)
|
||||
public IEnumerable<Stock> LoadInOrgs(params Guid[] orgId)
|
||||
{
|
||||
var result = from stock in Context.Stocks where orgId.Contains(stock.OrgId)
|
||||
var result = from stock in Context.Stocks where stock.OrgId != null && orgId.Contains(stock.OrgId.Value)
|
||||
select stock;
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public int GetStockCntInOrgs(params int[] orgIds)
|
||||
public int GetStockCntInOrgs(params Guid[] orgIds)
|
||||
{
|
||||
return LoadInOrgs(orgIds).Count();
|
||||
}
|
||||
|
||||
public IEnumerable<Stock> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds)
|
||||
public IEnumerable<Stock> 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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user