use IServerStartup rather than class naming convention to register server service class
This commit is contained in:
@ -2,10 +2,12 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Modules.HtmlText.Repository;
|
||||
using Oqtane.Modules.HtmlText.Services;
|
||||
|
||||
namespace Oqtane.Modules.HtmlText.Repository
|
||||
namespace Oqtane.Modules.HtmlText.Startup
|
||||
{
|
||||
public class HtmlTextDbContextFactory : IServerStartup
|
||||
public class ServerStartup : IServerStartup
|
||||
{
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
@ -19,6 +21,7 @@ namespace Oqtane.Modules.HtmlText.Repository
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddTransient<IHtmlTextService, ServerHtmlTextService>();
|
||||
services.AddDbContextFactory<HtmlTextContext>(opt => { }, ServiceLifetime.Transient);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user