use IServerStartup rather than class naming convention to register server service class

This commit is contained in:
sbwalker
2024-03-09 07:53:58 -05:00
parent 9106f9676c
commit 4457487e2a
2 changed files with 6 additions and 11 deletions

View File

@ -0,0 +1,28 @@
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.Startup
{
public class ServerStartup : IServerStartup
{
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// not implemented
}
public void ConfigureMvc(IMvcBuilder mvcBuilder)
{
// not implemented
}
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IHtmlTextService, ServerHtmlTextService>();
services.AddDbContextFactory<HtmlTextContext>(opt => { }, ServiceLifetime.Transient);
}
}
}