Browse Source

Enhance single layer startup template

Resolve #11361
pull/11363/head
maliming 4 years ago
parent
commit
81de89dde1
No known key found for this signature in database GPG Key ID: 96224957E51C89E
  1. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
  2. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs
  3. 16
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNolayersTemplate.cs
  4. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ar.json
  5. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/cs.json
  6. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/de-DE.json
  7. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/en-GB.json
  8. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/es.json
  9. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/fi.json
  10. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/fr.json
  11. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/hi.json
  12. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/hu.json
  13. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/is.json
  14. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/it.json
  15. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/nl.json
  16. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/pl-PL.json
  17. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/pt-BR.json
  18. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ro-RO.json
  19. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ru.json
  20. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/sk.json
  21. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/sl.json
  22. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/vi.json
  23. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/zh-Hans.json
  24. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/zh-Hant.json
  25. 78
      templates/app-nolayers/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj
  26. 49
      templates/app-nolayers/MyCompanyName.MyProjectName/MyProjectNameModule.cs
  27. 43
      templates/app-nolayers/MyCompanyName.MyProjectName/Program.cs
  28. 14
      templates/app-nolayers/MyCompanyName.MyProjectName/Startup.cs

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs

@ -278,7 +278,7 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
}
var matches = Regex.Matches(stringBuilder.ToString(),
$"({AppTemplate.TemplateName}|{AppProTemplate.TemplateName}|{ModuleTemplate.TemplateName}|{ModuleProTemplate.TemplateName}|{ConsoleTemplate.TemplateName}|{WpfTemplate.TemplateName})-(.+).zip");
$"({AppTemplate.TemplateName}|{AppNolayersTemplate.TemplateName}|{AppProTemplate.TemplateName}|{ModuleTemplate.TemplateName}|{ModuleProTemplate.TemplateName}|{ConsoleTemplate.TemplateName}|{WpfTemplate.TemplateName})-(.+).zip");
foreach (Match match in matches)
{
templateList.Add((match.Groups[1].Value, match.Groups[2].Value));

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs

@ -52,6 +52,8 @@ public class TemplateInfoProvider : ITemplateInfoProvider, ITransientDependency
{
case AppTemplate.TemplateName:
return new AppTemplate();
case AppNolayersTemplate.TemplateName:
return new AppNolayersTemplate();
case AppProTemplate.TemplateName:
return new AppProTemplate();
case MicroserviceProTemplate.TemplateName:

16
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNolayersTemplate.cs

@ -0,0 +1,16 @@
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
public class AppNolayersTemplate : AppTemplateBase
{
/// <summary>
/// "app".
/// </summary>
public const string TemplateName = "app-nolayers";
public AppNolayersTemplate()
: base(TemplateName)
{
//TODO: Change URL
DocumentUrl = CliConsts.DocsLink + "/en/abp/latest/Startup-Templates/Application";
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ar.json

@ -0,0 +1,7 @@
{
"culture": "ar",
"texts": {
"Welcome_Title": "مرحبا",
"Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/cs.json

@ -0,0 +1,7 @@
{
"culture": "cs",
"texts": {
"Welcome_Title": "Vítejte",
"Welcome_Text": "Toto je minimalistická šablona pro spuštění aplikace s jednou vrstvou pro ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/de-DE.json

@ -0,0 +1,7 @@
{
"culture": "de-DE",
"texts": {
"Welcome_Title": "Willkommen",
"Welcome_Text": "Dies ist eine minimalistische, einschichtige Anwendungsstartvorlage für das ABP-Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/en-GB.json

@ -0,0 +1,7 @@
{
"culture": "en-GB",
"texts": {
"Welcome_Title": "Welcome_Title",
"Welcome_Text": "This is a minimalist, single layer application startup template for the ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/es.json

@ -0,0 +1,7 @@
{
"culture": "es",
"texts": {
"Welcome_Title": "Bienvenido",
"Welcome_Text": "Esta es una plantilla de inicio de aplicación minimalista de una sola capa para ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/fi.json

@ -0,0 +1,7 @@
{
"culture": "fi",
"texts": {
"Welcome_Title": "Tervetuloa",
"Welcome_Text": "Tämä on minimalistinen yksikerroksinen sovelluksen käynnistysmalli ABP Frameworkille."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/fr.json

@ -0,0 +1,7 @@
{
"culture": "fr",
"texts": {
"Welcome_Title": "Bienvenue",
"Welcome_Text": "Il s'agit d'un modèle de démarrage d'application minimaliste à une seule couche pour le cadre ABP."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/hi.json

@ -0,0 +1,7 @@
{
"culture": "hi",
"texts": {
"Welcome_Title": "स्वागत हे",
"Welcome_Text": "यह एबीपी फ्रेमवर्क के लिए एक न्यूनतम, सिंगल लेयर एप्लिकेशन स्टार्टअप टेम्प्लेट है।"
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/hu.json

@ -0,0 +1,7 @@
{
"culture": "hu",
"texts": {
"Welcome_Title": "Üdvözlöm",
"Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/is.json

@ -0,0 +1,7 @@
{
"culture": "is",
"texts": {
"Welcome_Title": "Velkomin",
"Welcome_Text": "Þetta er lægstur, eins lags ræsingarsniðmát fyrir ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/it.json

@ -0,0 +1,7 @@
{
"culture": "it",
"texts": {
"Welcome_Title": "Benvenuto",
"Welcome_Text": "Questo è un modello di avvio dell'applicazione minimalista a livello singolo per ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/nl.json

@ -0,0 +1,7 @@
{
"culture": "nl",
"texts": {
"Welcome_Title": "Welkom",
"Welcome_Text": "Dit is een minimalistische, enkellaagse applicatie-opstartsjabloon voor het ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/pl-PL.json

@ -0,0 +1,7 @@
{
"culture": "pl-PL",
"texts": {
"Welcome_Title": "Witaj",
"Welcome_Text": "Jest to minimalistyczny, jednowarstwowy szablon uruchamiania aplikacji dla ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/pt-BR.json

@ -0,0 +1,7 @@
{
"culture": "pt-BR",
"texts": {
"Welcome_Title": "Seja bem-vindo!",
"Welcome_Text": "Este é um modelo de inicialização de aplicativo de camada única minimalista para o ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ro-RO.json

@ -0,0 +1,7 @@
{
"culture": "ro-RO",
"texts": {
"Welcome_Title": "Bun venit",
"Welcome_Text": "Acesta este un șablon de pornire a aplicației minimaliste, cu un singur strat, pentru Cadrul ABP."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ru.json

@ -0,0 +1,7 @@
{
"culture": "ru",
"texts": {
"Welcome_Title": "Bine ati venit",
"Welcome_Text": "Acesta este un șablon de pornire a aplicației minimaliste, cu un singur strat, pentru Cadrul ABP."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/sk.json

@ -0,0 +1,7 @@
{
"culture": "sk",
"texts": {
"Welcome_Title": "Vitajte",
"Welcome_Text": "Toto je minimalistická šablóna na spustenie aplikácie s jednou vrstvou pre rámec ABP."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/sl.json

@ -0,0 +1,7 @@
{
"culture": "sl",
"texts": {
"Welcome_Title": "Dobrodošli",
"Welcome_Text": "To je minimalistična enoslojna predloga za zagon aplikacije za ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/vi.json

@ -0,0 +1,7 @@
{
"culture": "vi",
"texts": {
"Welcome_Title": "Chào mừng bạn",
"Welcome_Text": "Đây là một mẫu khởi động ứng dụng lớp đơn, tối giản cho ABP Framework."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"Welcome_Title": "欢迎",
"Welcome_Text": "这是ABP框架的极简单层应用程序启动模板."
}
}

7
templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/zh-Hant.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hant",
"texts": {
"Welcome_Title": "歡迎",
"Welcome_Text": "這是 ABP 框架的極簡單層應用程序啟動模板."
}
}

78
templates/app-nolayers/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj

@ -10,70 +10,70 @@
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="5.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="5.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="5.0.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.0.0" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.Swashbuckle\Volo.Abp.Swashbuckle.csproj" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" />
<ProjectReference Include="..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Application" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="5.0.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="5.0.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="5.0.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Featuremanagement.Application" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Featuremanagement.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Featuremanagement.HttpApi" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Featuremanagement.Web" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.EntityFrameworkCore\Volo.Abp.Featuremanagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Web\Volo.Abp.Featuremanagement.Web.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.SettingManagement.Application" Version="5.0.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Volo.Abp.SettingManagement.HttpApi" Version="5.0.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Web" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Application\Volo.Abp.SettingManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.HttpApi\Volo.Abp.SettingManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Web\Volo.Abp.SettingManagement.Web.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.0.0" />
<ProjectReference Include="..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
@ -85,7 +85,7 @@
<Content Remove="Localization\MyProjectName\*.json" />
<EmbeddedResource Include="Localization\MyProjectName\*.json" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />

49
templates/app-nolayers/MyCompanyName.MyProjectName/MyProjectNameModule.cs

@ -53,39 +53,39 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
// Account module packages
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountWebIdentityServerModule),
// Identity module packages
typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpIdentityWebModule),
// Audit logging module packages
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
// Permission Management module packages
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
// Tenant Management module packages
typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpTenantManagementWebModule),
// Feature Management module packages
typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpFeatureManagementWebModule),
// Setting Management module packages
typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
@ -96,7 +96,7 @@ public class MyProjectNameModule : AbpModule
{
/* Single point to enable/disable multi-tenancy */
private const bool IsMultiTenant = true;
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
@ -154,7 +154,7 @@ public class MyProjectNameModule : AbpModule
);
});
}
private void ConfigureAuthentication(IServiceCollection services, IConfiguration configuration)
{
services.AddAuthentication()
@ -176,9 +176,26 @@ public class MyProjectNameModule : AbpModule
.AddVirtualJson("/Localization/MyProjectName");
options.DefaultResourceType = typeof(MyProjectNameResource);
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
options.Languages.Add(new LanguageInfo("ar", "ar", "العربية"));
options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština"));
options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)"));
options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar"));
options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish"));
options.Languages.Add(new LanguageInfo("fr", "fr", "Français"));
options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in"));
options.Languages.Add(new LanguageInfo("is", "is", "Icelandic", "is"));
options.Languages.Add(new LanguageInfo("it", "it", "Italiano", "it"));
options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português"));
options.Languages.Add(new LanguageInfo("ro-RO", "ro-RO", "Română"));
options.Languages.Add(new LanguageInfo("ru", "ru", "Русский"));
options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文"));
options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch", "de"));
options.Languages.Add(new LanguageInfo("es", "es", "Español"));
});
Configure<AbpExceptionLocalizationOptions>(options =>
@ -242,7 +259,7 @@ public class MyProjectNameModule : AbpModule
*/
options.AddDefaultRepositories(includeAllEntities: true);
});
Configure<AbpDbContextOptions>(options =>
{
options.Configure(configurationContext =>
@ -275,24 +292,24 @@ public class MyProjectNameModule : AbpModule
app.UseRouting();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
if (IsMultiTenant)
{
app.UseMultiTenancy();
}
app.UseUnitOfWork();
app.UseIdentityServer();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API");
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
}
}
}

43
templates/app-nolayers/MyCompanyName.MyProjectName/Program.cs

@ -5,32 +5,39 @@ namespace MyCompanyName.MyProjectName;
public class Program
{
public static int Main(string[] args)
public async static Task<int> Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
.CreateLogger();
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
Log.Information("Starting MyCompanyName.MyProjectName.");
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
await builder.AddApplicationAsync<MyProjectNameModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
Log.Fatal(ex, "MyCompanyName.MyProjectName terminated unexpectedly!");
return 1;
}
finally
@ -38,14 +45,4 @@ public class Program
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}
}

14
templates/app-nolayers/MyCompanyName.MyProjectName/Startup.cs

@ -1,14 +0,0 @@
namespace MyCompanyName.MyProjectName;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<MyProjectNameModule>();
}
public void Configure(IApplicationBuilder app)
{
app.InitializeApplication();
}
}
Loading…
Cancel
Save