Browse Source

Merge pull request #11368 from abpframework/auto-merge/rel-5-1/823

Merge branch dev with rel-5.1
pull/11374/head
liangshiwei 5 years ago
committed by GitHub
parent
commit
8c586e4737
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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. 29
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplate.cs
  4. 38
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
  5. 69
      templates/app-nolayers/MyCompanyName.MyProjectName/Data/DataSeederMiddleware.cs
  6. 5
      templates/app-nolayers/MyCompanyName.MyProjectName/Data/MyProjectNameDbContext.cs
  7. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ar.json
  8. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/cs.json
  9. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/de-DE.json
  10. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/en-GB.json
  11. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/es.json
  12. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/fi.json
  13. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/fr.json
  14. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/hi.json
  15. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/hu.json
  16. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/is.json
  17. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/it.json
  18. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/nl.json
  19. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/pl-PL.json
  20. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/pt-BR.json
  21. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ro-RO.json
  22. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/ru.json
  23. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/sk.json
  24. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/sl.json
  25. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/vi.json
  26. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/zh-Hans.json
  27. 7
      templates/app-nolayers/MyCompanyName.MyProjectName/Localization/MyProjectName/zh-Hant.json
  28. 16
      templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/20220119015238_Initial.Designer.cs
  29. 4
      templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/20220119015238_Initial.cs
  30. 14
      templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/MyProjectNameDbContextModelSnapshot.cs
  31. 82
      templates/app-nolayers/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj
  32. 49
      templates/app-nolayers/MyCompanyName.MyProjectName/MyProjectNameModule.cs
  33. 49
      templates/app-nolayers/MyCompanyName.MyProjectName/Program.cs
  34. 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(), 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) foreach (Match match in matches)
{ {
templateList.Add((match.Groups[1].Value, match.Groups[2].Value)); 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: case AppTemplate.TemplateName:
return new AppTemplate(); return new AppTemplate();
case AppNoLayersTemplate.TemplateName:
return new AppNoLayersTemplate();
case AppProTemplate.TemplateName: case AppProTemplate.TemplateName:
return new AppProTemplate(); return new AppProTemplate();
case MicroserviceProTemplate.TemplateName: case MicroserviceProTemplate.TemplateName:

29
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplate.cs

@ -0,0 +1,29 @@
using System.Collections.Generic;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
public class AppNoLayersTemplate : AppTemplateBase
{
/// <summary>
/// "app-nolayers".
/// </summary>
public const string TemplateName = "app-nolayers";
public AppNoLayersTemplate()
: base(TemplateName)
{
//TODO: Change URL
DocumentUrl = CliConsts.DocsLink + "/en/abp/latest/Startup-Templates/Application";
}
public override IEnumerable<ProjectBuildPipelineStep> GetCustomSteps(ProjectBuildContext context)
{
var steps = new List<ProjectBuildPipelineStep>();
RandomizeSslPorts(context, steps);
RandomizeStringEncryption(context, steps);
return steps;
}
}

38
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs

@ -43,7 +43,7 @@ public abstract class AppTemplateBase : TemplateInfo
return steps; return steps;
} }
private void ConfigureTenantSchema(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureTenantSchema(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (context.BuildArgs.ExtraProperties.ContainsKey("separate-tenant-schema")) if (context.BuildArgs.ExtraProperties.ContainsKey("separate-tenant-schema"))
{ {
@ -71,7 +71,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private void SwitchDatabaseProvider(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void SwitchDatabaseProvider(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (context.BuildArgs.DatabaseProvider == DatabaseProvider.MongoDb) if (context.BuildArgs.DatabaseProvider == DatabaseProvider.MongoDb)
{ {
@ -105,7 +105,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void DeleteUnrelatedProjects(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void DeleteUnrelatedProjects(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
switch (context.BuildArgs.UiFramework) switch (context.BuildArgs.UiFramework)
{ {
@ -170,7 +170,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private void ConfigurePublicWebSite(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigurePublicWebSite(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (!context.BuildArgs.PublicWebSite) if (!context.BuildArgs.PublicWebSite)
{ {
@ -206,7 +206,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void RemoveCmsKitDependenciesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps) protected static void RemoveCmsKitDependenciesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps)
{ {
var adminCmsPackageInstalledProjectsPackageJsonFiles = new List<string> var adminCmsPackageInstalledProjectsPackageJsonFiles = new List<string>
{ {
@ -233,7 +233,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private bool IsCmsKitSupportedForTargetVersion(ProjectBuildContext context) protected bool IsCmsKitSupportedForTargetVersion(ProjectBuildContext context)
{ {
if (string.IsNullOrWhiteSpace(context.BuildArgs.Version)) if (string.IsNullOrWhiteSpace(context.BuildArgs.Version))
{ {
@ -243,7 +243,7 @@ public abstract class AppTemplateBase : TemplateInfo
return SemanticVersion.Parse(context.BuildArgs.Version) > SemanticVersion.Parse("4.2.9"); return SemanticVersion.Parse(context.BuildArgs.Version) > SemanticVersion.Parse("4.2.9");
} }
private static void ConfigureWithoutUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureWithoutUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host"));
@ -263,7 +263,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void ConfigureWithBlazorUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureWithBlazorUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
context.Symbols.Add("ui:blazor"); context.Symbols.Add("ui:blazor");
@ -286,7 +286,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void ConfigureWithBlazorServerUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureWithBlazorServerUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
context.Symbols.Add("ui:blazor-server"); context.Symbols.Add("ui:blazor-server");
@ -312,7 +312,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void ConfigureWithMvcUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureWithMvcUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
context.Symbols.Add("ui:mvc"); context.Symbols.Add("ui:mvc");
@ -334,7 +334,7 @@ public abstract class AppTemplateBase : TemplateInfo
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds"));
} }
private static void ConfigureWithAngularUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureWithAngularUi(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
context.Symbols.Add("ui:angular"); context.Symbols.Add("ui:angular");
@ -362,12 +362,12 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void RemoveUnnecessaryPorts(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void RemoveUnnecessaryPorts(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
steps.Add(new RemoveUnnecessaryPortsStep()); steps.Add(new RemoveUnnecessaryPortsStep());
} }
private static void RandomizeSslPorts(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void RandomizeSslPorts(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (context.BuildArgs.ExtraProperties.ContainsKey("no-random-port")) if (context.BuildArgs.ExtraProperties.ContainsKey("no-random-port"))
{ {
@ -388,7 +388,7 @@ public abstract class AppTemplateBase : TemplateInfo
); );
} }
private void ConfigureTieredArchitecture(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ConfigureTieredArchitecture(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Tiered.Long) || if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Tiered.Long) ||
context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server")) context.BuildArgs.ExtraProperties.ContainsKey("separate-identity-server"))
@ -397,17 +397,17 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void RandomizeStringEncryption(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void RandomizeStringEncryption(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
steps.Add(new RandomizeStringEncryptionStep()); steps.Add(new RandomizeStringEncryptionStep());
} }
private static void UpdateNuGetConfig(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void UpdateNuGetConfig(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
steps.Add(new UpdateNuGetConfigStep("/aspnet-core/NuGet.Config")); steps.Add(new UpdateNuGetConfigStep("/aspnet-core/NuGet.Config"));
} }
private void RemoveMigrations(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void RemoveMigrations(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (string.IsNullOrWhiteSpace(context.BuildArgs.Version) || if (string.IsNullOrWhiteSpace(context.BuildArgs.Version) ||
SemanticVersion.Parse(context.BuildArgs.Version) > new SemanticVersion(4, 1, 99)) SemanticVersion.Parse(context.BuildArgs.Version) > new SemanticVersion(4, 1, 99))
@ -425,7 +425,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void ChangeConnectionString(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void ChangeConnectionString(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (context.BuildArgs.ConnectionString != null) if (context.BuildArgs.ConnectionString != null)
{ {
@ -433,7 +433,7 @@ public abstract class AppTemplateBase : TemplateInfo
} }
} }
private static void CleanupFolderHierarchy(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) protected void CleanupFolderHierarchy(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if ((context.BuildArgs.UiFramework == UiFramework.Mvc if ((context.BuildArgs.UiFramework == UiFramework.Mvc
|| context.BuildArgs.UiFramework == UiFramework.Blazor || context.BuildArgs.UiFramework == UiFramework.Blazor

69
templates/app-nolayers/MyCompanyName.MyProjectName/Data/DataSeederMiddleware.cs

@ -2,46 +2,47 @@
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity; using Volo.Abp.Identity;
namespace MyCompanyName.MyProjectName.Data namespace MyCompanyName.MyProjectName.Data;
public class DataSeederMiddleware : IMiddleware, ISingletonDependency
{ {
public class DataSeederMiddleware : IMiddleware, ISingletonDependency private bool _hostSeeded;
{
private bool _hostSeeded;
private readonly ILogger<DataSeederMiddleware> _logger; private readonly ILogger<DataSeederMiddleware> _logger;
private readonly IDataSeeder _dataSeeder; private readonly IDataSeeder _dataSeeder;
public DataSeederMiddleware( public DataSeederMiddleware(
ILogger<DataSeederMiddleware> logger, ILogger<DataSeederMiddleware> logger,
IDataSeeder dataSeeder) IDataSeeder dataSeeder)
{ {
_logger = logger; _logger = logger;
_dataSeeder = dataSeeder; _dataSeeder = dataSeeder;
} }
public async Task InvokeAsync(HttpContext context, RequestDelegate next) public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
/* This logic is not safe if you are running multiple instances of your
* application in parallel. In that case, a distributed lock usage is suggested,
* or you can create another application for database migration/seed.
*/
if (!_hostSeeded)
{ {
/* This logic is not safe if you are running multiple instances of your await SeedHostDataAsync();
* application in parallel. In that case, a distributed lock usage is suggested, _hostSeeded = true;
* or you can create another application for database migration/seed.
*/
if (!_hostSeeded)
{
await SeedHostDataAsync();
_hostSeeded = true;
}
await next(context);
} }
private Task SeedHostDataAsync() await next(context);
{ }
_logger.LogInformation($"Executing database seed...");
private Task SeedHostDataAsync()
return _dataSeeder.SeedAsync(new DataSeedContext() {
.WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) _logger.LogInformation($"Executing database seed...");
.WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue)
); return _dataSeeder.SeedAsync(new DataSeedContext()
} .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName,
IdentityDataSeedContributor.AdminEmailDefaultValue)
.WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName,
IdentityDataSeedContributor.AdminPasswordDefaultValue)
);
} }
} }

5
templates/app-nolayers/MyCompanyName.MyProjectName/Data/MyProjectNameDbContext.cs

@ -1,7 +1,6 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore;
@ -31,7 +30,7 @@ public class MyProjectNameDbContext : AbpDbContext<MyProjectNameDbContext>
builder.ConfigureIdentityServer(); builder.ConfigureIdentityServer();
builder.ConfigureFeatureManagement(); builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement(); builder.ConfigureTenantManagement();
/* Configure your own entities here */ /* Configure your own entities here */
} }
} }

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 框架的極簡單層應用程序啟動模板."
}
}

16
templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/20220116184845_Initial.Designer.cs → templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/20220119015238_Initial.Designer.cs

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Migrations namespace MyCompanyName.MyProjectName.Migrations
{ {
[DbContext(typeof(MyProjectNameDbContext))] [DbContext(typeof(MyProjectNameDbContext))]
[Migration("20220116184845_Initial")] [Migration("20220119015238_Initial")]
partial class Initial partial class Initial
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -100,16 +100,28 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("ImpersonatorTenantId"); .HasColumnName("ImpersonatorTenantId");
b.Property<string>("ImpersonatorTenantName")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("ImpersonatorTenantName");
b.Property<Guid?>("ImpersonatorUserId") b.Property<Guid?>("ImpersonatorUserId")
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("ImpersonatorUserId"); .HasColumnName("ImpersonatorUserId");
b.Property<string>("ImpersonatorUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("ImpersonatorUserName");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("TenantId"); .HasColumnName("TenantId");
b.Property<string>("TenantName") b.Property<string>("TenantName")
.HasColumnType("nvarchar(max)"); .HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("TenantName");
b.Property<string>("Url") b.Property<string>("Url")
.HasMaxLength(256) .HasMaxLength(256)

4
templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/20220116184845_Initial.cs → templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/20220119015238_Initial.cs

@ -18,9 +18,11 @@ namespace MyCompanyName.MyProjectName.Migrations
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantName = table.Column<string>(type: "nvarchar(max)", nullable: true), TenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ImpersonatorUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), ImpersonatorUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ImpersonatorUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ImpersonatorTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), ImpersonatorTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ImpersonatorTenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ExecutionTime = table.Column<DateTime>(type: "datetime2", nullable: false), ExecutionTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ExecutionDuration = table.Column<int>(type: "int", nullable: false), ExecutionDuration = table.Column<int>(type: "int", nullable: false),
ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),

14
templates/app-nolayers/MyCompanyName.MyProjectName/Migrations/MyProjectNameDbContextModelSnapshot.cs

@ -98,16 +98,28 @@ namespace MyCompanyName.MyProjectName.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("ImpersonatorTenantId"); .HasColumnName("ImpersonatorTenantId");
b.Property<string>("ImpersonatorTenantName")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("ImpersonatorTenantName");
b.Property<Guid?>("ImpersonatorUserId") b.Property<Guid?>("ImpersonatorUserId")
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("ImpersonatorUserId"); .HasColumnName("ImpersonatorUserId");
b.Property<string>("ImpersonatorUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("ImpersonatorUserName");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("TenantId"); .HasColumnName("TenantId");
b.Property<string>("TenantName") b.Property<string>("TenantName")
.HasColumnType("nvarchar(max)"); .HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("TenantName");
b.Property<string>("Url") b.Property<string>("Url")
.HasMaxLength(256) .HasMaxLength(256)

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

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

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

@ -53,39 +53,39 @@ namespace MyCompanyName.MyProjectName;
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule),
// Account module packages // Account module packages
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule), typeof(AbpAccountHttpApiModule),
typeof(AbpAccountWebIdentityServerModule), typeof(AbpAccountWebIdentityServerModule),
// Identity module packages // Identity module packages
typeof(AbpIdentityApplicationModule), typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityHttpApiModule), typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpIdentityWebModule), typeof(AbpIdentityWebModule),
// Audit logging module packages // Audit logging module packages
typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule),
// Permission Management module packages // Permission Management module packages
typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule), typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
// Tenant Management module packages // Tenant Management module packages
typeof(AbpTenantManagementApplicationModule), typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule), typeof(AbpTenantManagementHttpApiModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpTenantManagementWebModule), typeof(AbpTenantManagementWebModule),
// Feature Management module packages // Feature Management module packages
typeof(AbpFeatureManagementApplicationModule), typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementHttpApiModule), typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpFeatureManagementWebModule), typeof(AbpFeatureManagementWebModule),
// Setting Management module packages // Setting Management module packages
typeof(AbpSettingManagementApplicationModule), typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
@ -96,7 +96,7 @@ public class MyProjectNameModule : AbpModule
{ {
/* Single point to enable/disable multi-tenancy */ /* Single point to enable/disable multi-tenancy */
private const bool IsMultiTenant = true; private const bool IsMultiTenant = true;
public override void PreConfigureServices(ServiceConfigurationContext context) public override void PreConfigureServices(ServiceConfigurationContext context)
{ {
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options => context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
@ -154,7 +154,7 @@ public class MyProjectNameModule : AbpModule
); );
}); });
} }
private void ConfigureAuthentication(IServiceCollection services, IConfiguration configuration) private void ConfigureAuthentication(IServiceCollection services, IConfiguration configuration)
{ {
services.AddAuthentication() services.AddAuthentication()
@ -176,9 +176,26 @@ public class MyProjectNameModule : AbpModule
.AddVirtualJson("/Localization/MyProjectName"); .AddVirtualJson("/Localization/MyProjectName");
options.DefaultResourceType = typeof(MyProjectNameResource); options.DefaultResourceType = typeof(MyProjectNameResource);
options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); 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 => Configure<AbpExceptionLocalizationOptions>(options =>
@ -242,7 +259,7 @@ public class MyProjectNameModule : AbpModule
*/ */
options.AddDefaultRepositories(includeAllEntities: true); options.AddDefaultRepositories(includeAllEntities: true);
}); });
Configure<AbpDbContextOptions>(options => Configure<AbpDbContextOptions>(options =>
{ {
options.Configure(configurationContext => options.Configure(configurationContext =>
@ -275,24 +292,24 @@ public class MyProjectNameModule : AbpModule
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();
app.UseJwtTokenMiddleware(); app.UseJwtTokenMiddleware();
if (IsMultiTenant) if (IsMultiTenant)
{ {
app.UseMultiTenancy(); app.UseMultiTenancy();
} }
app.UseUnitOfWork(); app.UseUnitOfWork();
app.UseIdentityServer(); app.UseIdentityServer();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseAbpSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API");
}); });
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints(); app.UseConfiguredEndpoints();
} }
} }

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

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