Open Source Web Application Framework for ASP.NET Core
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.
 
 
 
 
 
 

24 lines
707 B

using System;
using Volo.Blogging.EntityFrameworkCore;
namespace Volo.Blogging
{
public abstract class BloggingApplicationTestBase : BloggingTestBase<BloggingApplicationTestModule>
{
protected virtual void UsingDbContext(Action<IBloggingDbContext> action)
{
using (var dbContext = GetRequiredService<IBloggingDbContext>())
{
action.Invoke(dbContext);
}
}
protected virtual T UsingDbContext<T>(Func<IBloggingDbContext, T> action)
{
using (var dbContext = GetRequiredService<IBloggingDbContext>())
{
return action.Invoke(dbContext);
}
}
}
}