build: 升级目标框架到net10.0并完善模板配置
1. 将Hua.Cli.Tests、项目共享库、模块项目等所有项目的TargetFramework从net8.0/net9.0升级到net10.0 2. 完善dotnet-tools.json、模板配置文件,添加必要的构建和发布配置 3. 新增微服务、网关、应用程序的启动脚本和基础配置文件 4. 补充产品管理模块的领域、应用、Web层基础代码和多语言资源
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Volo.Abp.AuditLogging.EntityFrameworkCore;
|
||||
using Volo.Abp.EntityFrameworkCore;
|
||||
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
|
||||
using Volo.Abp.Identity.EntityFrameworkCore;
|
||||
using Volo.Abp.IdentityServer.EntityFrameworkCore;
|
||||
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
|
||||
using Volo.Abp.SettingManagement.EntityFrameworkCore;
|
||||
using Volo.Abp.TenantManagement.EntityFrameworkCore;
|
||||
|
||||
namespace Company.Project.AuthServer.EntityFrameworkCore;
|
||||
|
||||
public class AuthServerDbContext : AbpDbContext<AuthServerDbContext>
|
||||
{
|
||||
public AuthServerDbContext(DbContextOptions<AuthServerDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.ConfigureIdentity();
|
||||
modelBuilder.ConfigureIdentityServer();
|
||||
modelBuilder.ConfigureAuditLogging();
|
||||
modelBuilder.ConfigurePermissionManagement();
|
||||
modelBuilder.ConfigureSettingManagement();
|
||||
modelBuilder.ConfigureTenantManagement();
|
||||
modelBuilder.ConfigureFeatureManagement();
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
using System.IO;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Company.Project.AuthServer.EntityFrameworkCore;
|
||||
|
||||
public class AuthServerDbContextFactory : IDesignTimeDbContextFactory<AuthServerDbContext>
|
||||
{
|
||||
public AuthServerDbContext CreateDbContext(string[] args)
|
||||
{
|
||||
var configuration = BuildConfiguration();
|
||||
|
||||
var builder = new DbContextOptionsBuilder<AuthServerDbContext>()
|
||||
.UseSqlServer(configuration.GetConnectionString("Default"));
|
||||
|
||||
return new AuthServerDbContext(builder.Options);
|
||||
}
|
||||
|
||||
private static IConfigurationRoot BuildConfiguration()
|
||||
{
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", optional: false);
|
||||
|
||||
return builder.Build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user