diff --git a/.gitignore b/.gitignore index bd2d7057..69863764 100644 --- a/.gitignore +++ b/.gitignore @@ -22,10 +22,14 @@ Oqtane.Server/Packages Oqtane.Server/wwwroot/Content Oqtane.Server/wwwroot/Packages/*.log -Oqtane.Server/wwwroot/Modules +Oqtane.Server/wwwroot/Modules/* !Oqtane.Server/wwwroot/Modules/Oqtane.Modules.* !Oqtane.Server/wwwroot/Modules/Templates +Oqtane.Server/wwwroot/Modules/Templates/* +!Oqtane.Server/wwwroot/Modules/Templates/External -Oqtane.Server/wwwroot/Themes +Oqtane.Server/wwwroot/Themes/* !Oqtane.Server/wwwroot/Themes/Oqtane.Themes.* !Oqtane.Server/wwwroot/Themes/Templates +Oqtane.Server/wwwroot/Themes/Templates/* +Oqtane.Server/wwwroot/Themes/Templates/External diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Startup/ClientStartup.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Startup/ClientStartup.cs new file mode 100644 index 00000000..611b5a8e --- /dev/null +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Startup/ClientStartup.cs @@ -0,0 +1,14 @@ +using Microsoft.Extensions.DependencyInjection; +using Oqtane.Services; +using [Owner].Module.[Module].Services; + +namespace [Owner].Module.[Module].Startup +{ + public class ClientStartup : IClientStartup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddScoped(); + } + } +} diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Startup/ServerStartup.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Startup/ServerStartup.cs new file mode 100644 index 00000000..a5491925 --- /dev/null +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Startup/ServerStartup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Oqtane.Infrastructure; +using [Owner].Module.[Module].Repository; +using [Owner].Module.[Module].Services; + +namespace [Owner].Module.[Module].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(); + services.AddDbContextFactory<[Module]Context>(opt => { }, ServiceLifetime.Transient); + } + } +}