use IServerStartup for registering DbContextFactory

This commit is contained in:
sbwalker
2024-03-08 07:39:34 -05:00
parent 31f1079dfa
commit 074fcaaa73
2 changed files with 25 additions and 13 deletions

View File

@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Oqtane.Infrastructure;
namespace Oqtane.Modules.HtmlText.Repository
{
public class HtmlTextDbContextFactory : IServerStartup
{
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// not implemented
}
public void ConfigureMvc(IMvcBuilder mvcBuilder)
{
// not implemented
}
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContextFactory<HtmlTextContext>(opt => { }, ServiceLifetime.Transient);
}
}
}