using CMS.Plugin.SycWmsDemo.EntityFrameworkCore; using CMS.Plugin.SycWmsDemo.MySQL; using CMS.Plugin.SycWmsDemo.TestBase; namespace CMS.Plugin.SycWmsDemo.Application.Tests { /// /// SycWmsDemoApplicationTestBase /// public class SycWmsDemoApplicationTestBase : SycWmsDemoTestBase { /// /// UsingDbContext /// /// ISycWmsDemoDbContext protected virtual void UsingDbContext(Action action) { using (var dbContext = GetRequiredService()) { action.Invoke(dbContext); } } /// /// UsingDbContext /// /// T /// ISycWmsDemoDbContext /// T protected virtual T UsingDbContext(Func action) { using (var dbContext = GetRequiredService()) { return action.Invoke(dbContext); } } } }