Browse Source
Merge pull request #11883 from abpframework/auto-merge/rel-5-2/918
Merge branch dev with rel-5.2
pull/11885/head
liangshiwei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with
42 additions and
2 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs
|
|
|
@ -41,6 +41,11 @@ public abstract class AppNoLayersTemplateBase : AppTemplateBase |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
if (context.BuildArgs.DatabaseManagementSystem == DatabaseManagementSystem.PostgreSQL) |
|
|
|
{ |
|
|
|
context.Symbols.Add("dbms:PostgreSQL"); |
|
|
|
} |
|
|
|
|
|
|
|
switch (context.BuildArgs.UiFramework) |
|
|
|
{ |
|
|
|
case UiFramework.Angular: |
|
|
|
|
|
|
|
@ -103,6 +103,11 @@ public abstract class AppTemplateBase : TemplateInfo |
|
|
|
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.MongoDB")); |
|
|
|
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.MongoDB.Tests", projectFolderPath: "/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests")); |
|
|
|
} |
|
|
|
|
|
|
|
if (context.BuildArgs.DatabaseManagementSystem == DatabaseManagementSystem.PostgreSQL) |
|
|
|
{ |
|
|
|
context.Symbols.Add("dbms:PostgreSQL"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected void DeleteUnrelatedProjects(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) |
|
|
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using MyCompanyName.MyProjectName.Blazor.Server; |
|
|
|
using MyCompanyName.MyProjectName.Data; |
|
|
|
using Serilog; |
|
|
|
@ -9,6 +10,11 @@ public class Program |
|
|
|
{ |
|
|
|
public async static Task<int> Main(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
|
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
var loggerConfiguration = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using MyCompanyName.MyProjectName.Data; |
|
|
|
using Serilog; |
|
|
|
using Serilog.Events; |
|
|
|
@ -8,6 +9,11 @@ public class Program |
|
|
|
{ |
|
|
|
public async static Task<int> Main(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
|
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
var loggerConfiguration = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
using System; |
|
|
|
using MyCompanyName.MyProjectName.Data; |
|
|
|
using Serilog; |
|
|
|
using Serilog.Events; |
|
|
|
@ -9,6 +10,11 @@ public class Program |
|
|
|
{ |
|
|
|
public async static Task<int> Main(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
|
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
var loggerConfiguration = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System.IO; |
|
|
|
using System; |
|
|
|
using System.IO; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Microsoft.EntityFrameworkCore.Design; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
@ -11,6 +12,11 @@ public class MyProjectNameDbContextFactory : IDesignTimeDbContextFactory<MyProje |
|
|
|
{ |
|
|
|
public MyProjectNameDbContext CreateDbContext(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
|
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
MyProjectNameEfCoreEntityExtensionMappings.Configure(); |
|
|
|
|
|
|
|
var configuration = BuildConfiguration(); |
|
|
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using System; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|
|
|
using Volo.Abp.BackgroundJobs.EntityFrameworkCore; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
@ -29,6 +30,11 @@ public class MyProjectNameEntityFrameworkCoreModule : AbpModule |
|
|
|
{ |
|
|
|
public override void PreConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
|
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
MyProjectNameEfCoreEntityExtensionMappings.Configure(); |
|
|
|
} |
|
|
|
|
|
|
|
|