|
|
@ -7,6 +7,7 @@ using Microsoft.EntityFrameworkCore; |
|
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.OpenIddict.EntityFrameworkCore; |
|
|
using Volo.Abp.OpenIddict.EntityFrameworkCore; |
|
|
|
|
|
using System.Linq.Dynamic.Core; |
|
|
|
|
|
|
|
|
namespace Volo.Abp.OpenIddict.Scopes; |
|
|
namespace Volo.Abp.OpenIddict.Scopes; |
|
|
|
|
|
|
|
|
@ -18,6 +19,27 @@ public class EfCoreOpenIddictScopeRepository : EfCoreRepository<IOpenIddictDbCon |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<List<OpenIddictScope>> GetListAsync(string sorting, int skipCount, int maxResultCount, string filter = null, |
|
|
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
|
|
{ |
|
|
|
|
|
return await (await GetDbSetAsync()) |
|
|
|
|
|
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) |
|
|
|
|
|
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.DisplayName.Contains(filter)) |
|
|
|
|
|
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Description.Contains(filter)) |
|
|
|
|
|
.OrderBy(sorting.IsNullOrWhiteSpace() ? nameof(OpenIddictScope.Name) : sorting) |
|
|
|
|
|
.PageBy(skipCount, maxResultCount) |
|
|
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default) |
|
|
|
|
|
{ |
|
|
|
|
|
return await (await GetDbSetAsync()) |
|
|
|
|
|
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) |
|
|
|
|
|
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.DisplayName.Contains(filter)) |
|
|
|
|
|
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Description.Contains(filter)) |
|
|
|
|
|
.LongCountAsync(GetCancellationToken(cancellationToken)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task<OpenIddictScope> FindByIdAsync(Guid id, CancellationToken cancellationToken = default) |
|
|
public virtual async Task<OpenIddictScope> FindByIdAsync(Guid id, CancellationToken cancellationToken = default) |
|
|
{ |
|
|
{ |
|
|
return await (await GetQueryableAsync()).FirstOrDefaultAsync(x => x.Id == id, GetCancellationToken(cancellationToken)); |
|
|
return await (await GetQueryableAsync()).FirstOrDefaultAsync(x => x.Id == id, GetCancellationToken(cancellationToken)); |
|
|
|