|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
|
|
|
|
@ -8,7 +9,8 @@ using Volo.Abp.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.PermissionManagement.EntityFrameworkCore
|
|
|
|
|
{
|
|
|
|
|
public class EfCorePermissionGrantRepository : EfCoreRepository<IPermissionManagementDbContext, PermissionGrant, Guid>, IPermissionGrantRepository
|
|
|
|
|
public class EfCorePermissionGrantRepository : EfCoreRepository<IPermissionManagementDbContext, PermissionGrant, Guid>,
|
|
|
|
|
IPermissionGrantRepository
|
|
|
|
|
{
|
|
|
|
|
public EfCorePermissionGrantRepository(IDbContextProvider<IPermissionManagementDbContext> dbContextProvider)
|
|
|
|
|
: base(dbContextProvider)
|
|
|
|
@ -16,23 +18,31 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<PermissionGrant> FindAsync(string name, string providerName, string providerKey)
|
|
|
|
|
public async Task<PermissionGrant> FindAsync(
|
|
|
|
|
string name,
|
|
|
|
|
string providerName,
|
|
|
|
|
string providerKey,
|
|
|
|
|
CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
return await DbSet
|
|
|
|
|
.FirstOrDefaultAsync(s =>
|
|
|
|
|
s.Name == name &&
|
|
|
|
|
s.ProviderName == providerName &&
|
|
|
|
|
s.ProviderKey == providerKey
|
|
|
|
|
s.ProviderKey == providerKey,
|
|
|
|
|
GetCancellationToken(cancellationToken)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<List<PermissionGrant>> GetListAsync(string providerName, string providerKey)
|
|
|
|
|
public async Task<List<PermissionGrant>> GetListAsync(
|
|
|
|
|
string providerName,
|
|
|
|
|
string providerKey,
|
|
|
|
|
CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
return await DbSet
|
|
|
|
|
.Where(s =>
|
|
|
|
|
s.ProviderName == providerName &&
|
|
|
|
|
s.ProviderKey == providerKey
|
|
|
|
|
).ToListAsync();
|
|
|
|
|
).ToListAsync(GetCancellationToken(cancellationToken));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|