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.
abp/modules/permission-management/test/Volo.Abp.PermissionManageme.../Volo/Abp/PermissionManagement/PermissionTestBase.cs

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);
}
}
}
}