Skip to content

Commit

Permalink
修正缺少默认EnvOptions的配置的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
witskeeper committed Sep 1, 2024
1 parent 14913e2 commit 1324d2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion template/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<NetCorePalVersion>1.2.1</NetCorePalVersion>
<NetCorePalVersion>2.0.0-preview.1.2408311353</NetCorePalVersion>
<FrameworkVersion>8.0.0</FrameworkVersion>
<ExtensionsVersion>8.0.0</ExtensionsVersion>
<EntityFrameworkVersion>8.0.0</EntityFrameworkVersion>
Expand Down
3 changes: 3 additions & 0 deletions template/src/ABC.Template.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Hangfire;
using Hangfire.Redis.StackExchange;
using NetCorePal.Extensions.AspNetCore.Json;
using NetCorePal.Extensions.MultiEnv;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Refit;
Expand Down Expand Up @@ -126,6 +127,8 @@
builder.Services.AddUnitOfWork<ApplicationDbContext>();
builder.Services.AddMySqlTransactionHandler();
builder.Services.AddRedisLocks();
//配置多环境Options
builder.Services.Configure<EnvOptions>(envOptions => builder.Configuration.GetSection("Env").Bind(envOptions));
builder.Services.AddContext().AddEnvContext().AddCapContextProcessor();
builder.Services.AddNetCorePalServiceDiscoveryClient();
builder.Services.AddIntegrationEventServices(typeof(Program))
Expand Down

0 comments on commit 1324d2f

Please sign in to comment.