optimize client startup in templates
This commit is contained in:
@ -8,7 +8,10 @@ namespace Oqtane.Application.Startup
|
|||||||
{
|
{
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddScoped<IMyModuleService, MyModuleService>();
|
if (!services.Any(s => s.ServiceType == typeof(IMyModuleService)))
|
||||||
|
{
|
||||||
|
services.AddScoped<IMyModuleService, MyModuleService>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,10 @@ namespace [Owner].Module.[Module].Startup
|
|||||||
{
|
{
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddScoped<I[Module]Service, [Module]Service>();
|
if (!services.Any(s => s.ServiceType == typeof(I[Module]Service)))
|
||||||
|
{
|
||||||
|
services.AddScoped<I[Module]Service, [Module]Service>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user