mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
795 B
25 lines
795 B
using System;
|
|
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
|
|
|
|
namespace Volo.Abp.PermissionManagement
|
|
{
|
|
public abstract class PermissionTestBase : PermissionManagementTestBase<AbpPermissionManagementTestModule>
|
|
{
|
|
protected virtual void UsingDbContext(Action<IPermissionManagementDbContext> action)
|
|
{
|
|
using (var dbContext = GetRequiredService<IPermissionManagementDbContext>())
|
|
{
|
|
action.Invoke(dbContext);
|
|
}
|
|
}
|
|
|
|
protected virtual T UsingDbContext<T>(Func<IPermissionManagementDbContext, T> action)
|
|
{
|
|
using (var dbContext = GetRequiredService<IPermissionManagementDbContext>())
|
|
{
|
|
return action.Invoke(dbContext);
|
|
}
|
|
}
|
|
}
|
|
}
|