Compare commits

...

24 Commits

Author SHA1 Message Date
百小僧
e73c623634 😊 发布 v4.9.5.26 版本,修复上一版本引起的 Serializer options cannot be changed once serialization or deserialization has occurred. 错误 2024-11-22 14:06:47 +08:00
百小僧
4cc25e69f4 😊 发布 v4.9.5.25 版本,修复授权异常和 UseUnifyResultStatusCodes() 中间件冲突问题 2024-11-22 11:57:09 +08:00
百小僧
4045aa7824 😊 修复 在授权时发生内部异常导致响应体被重复写入问题 2024-11-22 11:34:08 +08:00
百小僧
72729e3971 😊 发布 v4.9.5.24 版本,改进事件总线获取负载数据方式 2024-11-20 10:58:59 +08:00
百小僧
6247d596b8 😊 新增 事件总线获取负载数据 context.GetPayload<T>() 拓展方法 2024-11-20 10:46:05 +08:00
百小僧
3551a00b00 😊 发布 v4.9.5.23 版本,修复程序集扫描加载模块问题 2024-11-17 00:51:24 +08:00
百小僧
44fe2bb278 😊 修复 程序集扫描无法正确扫描运行时实际模块化依赖列表 2024-11-17 00:39:44 +08:00
百小僧
390a78437e 😊 发布 v4.9.5.22 版本,修复粘土对象序列化问题 2024-11-15 16:56:53 +08:00
百小僧
27a3fbc46e 😊 修复 粘土对象序列化返回不支持配置 大小写问题 2024-11-15 16:47:03 +08:00
百小僧
b401ff4744 😊 发布 v4.9.5.21 版本,修复 EFCore 9.0 迁移异常 #IB41YD 2024-11-13 15:56:41 +08:00
百小僧
4b5309d6a0 😊 修复 .NET 9.0 版本的 EFCore 迁移异常 #IB41YD 2024-11-13 15:36:07 +08:00
百小僧
fba707fda4 😊 发布 v4.9.5.19 版本,适配 .NET9 正式版,脚手架默认创建为 .NET9 2024-11-13 13:20:35 +08:00
百小僧
8716e76826 😊 更新 v4 版本工具版本 2024-11-12 00:56:04 +08:00
百小僧
63372e29ff 😊 新增 监听异常日志提供更多信息 2024-11-05 23:12:01 +08:00
百小僧
883c50d214 😊 发布 v4.9.5.18 版本,新增 EFCore 分表删除 2024-10-31 01:39:17 +08:00
百小僧
f405dbe970 😊 添加分表删除时对空数据的判断 2024-10-30 19:38:38 +08:00
百小僧
ee1476847a 😊 添加 分表删除记录操作 2024-10-30 18:12:59 +08:00
百小僧
8ab69cdecd 😊 发布 v4.9.5.17 版本,新增 EFCore 分表更新操作 2024-10-22 01:02:07 +08:00
百小僧
2ff66ce4e0 😊 新增 EFCore 支持分表更新 2024-10-22 00:43:54 +08:00
百小僧
ec7f31a6c2 😊 新增 远程请求 [BaseAddress] 支持读取配置模板 #IAYC82 2024-10-20 17:16:05 +08:00
百小僧
9243258544 😊 发布 v4.9.5.16 版本,修复 Swagger 登录输入框不支持特殊符号 #IAXDZM 2024-10-16 10:41:18 +08:00
百小僧
2d7b20f03c 😊 修复 启用 Swagger 登录 UI 后输入不支持特殊字母 #IAXDZM 2024-10-16 10:16:50 +08:00
百小僧
f28377cfce 😊 恢复分支代码 2024-10-14 15:15:05 +08:00
百小僧
ac41f34f6e 😊 发布 v4.9.5.15 版本,修复插件化无法加载问题 #IAWDBM 2024-10-14 14:49:05 +08:00
167 changed files with 2093 additions and 277 deletions

View File

@@ -13,7 +13,18 @@ body:
label:
description: 使 Furion
options:
- 4.9.5.15 ()
- 4.9.5.26 ()
- 4.9.5.25
- 4.9.5.24
- 4.9.5.23
- 4.9.5.22
- 4.9.5.21
- 4.9.5.20
- 4.9.5.19
- 4.9.5.18
- 4.9.5.17
- 4.9.5.16
- 4.9.5.15
- 4.9.5.14
- 4.9.5.13
- 4.9.5.12

View File

@@ -1,9 +1,8 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Version>4.9.5.15</Version>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<Version>4.9.5.26</Version>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>百小僧</Authors>
<Company>百签科技(广东)有限公司</Company>
<Product>Furion</Product>

View File

@@ -4,12 +4,20 @@
<Description>Furion Jwt 授权验证拓展插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.36" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.20" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0-rc.2.24474.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
</ItemGroup>
</Project>

View File

@@ -4,16 +4,24 @@
<Description>Furion 数据库访问器 Dapper 插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.44" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
</ItemGroup>

View File

@@ -4,16 +4,24 @@
<Description>Furion 数据库访问器 MongoDB 插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="MongoDB.Driver" Version="3.0.0" />
</ItemGroup>
</Project>

View File

@@ -4,16 +4,24 @@
<Description>Furion 数据库访问器 SqlSugar 插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="sqlSugarCore" Version="5.1.4.169" />
<PackageReference Include="sqlSugarCore" Version="5.1.4.170" />
</ItemGroup>
</Project>

View File

@@ -4,23 +4,37 @@
<Description>Furion 程序集扫描和代码分析拓展插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.36" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.36" />
<PackageReference Include="System.Text.Json" Version="6.0.11" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.20" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.20" />
<PackageReference Include="System.Text.Json" Version="7.0.4" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0-rc.2.24474.1" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0-rc.2.24474.3" />
<PackageReference Include="System.Text.Json" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.35" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.36" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

View File

@@ -5,14 +5,24 @@
<NoWarn>0618</NoWarn>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
</ItemGroup>
</Project>

View File

@@ -4,16 +4,28 @@
<Description>Furion 对象映射 Mapster 插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Mapster" Version="7.4.0" />
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
</ItemGroup>
</Project>

View File

@@ -4,21 +4,33 @@
<Description>Furion 程序集扫描和代码分析拓展插件。</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.36" />
<PackageReference Include="System.Text.Json" Version="6.0.11" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.20" />
<PackageReference Include="System.Text.Json" Version="7.0.4" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0-rc.2.24474.3" />
<PackageReference Include="System.Text.Json" Version="9.0.0-rc.2.24473.5" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.35" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.36" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

View File

@@ -531,7 +531,7 @@ public static class App
scanAssemblies = dependencyContext.RuntimeLibraries
.Where(u =>
(u.Type == "project" && !excludeAssemblyNames.Any(j => u.Name.EndsWith(j))) ||
(u.Type == "package" && (u.Name.StartsWith(nameof(Furion)) || supportPackageNamePrefixs.Any(p => u.Name.StartsWith(p)))) ||
(u.Type == "package" && (u.Name.StartsWith(nameof(Furion)) || supportPackageNamePrefixs.Any(p => u.Name.StartsWith(p) && u.RuntimeAssemblyGroups.Count > 0))) ||
(Settings.EnabledReferenceAssemblyScan == true && u.Type == "reference")) // 判断是否启用引用程序集扫描
.Select(u => Reflect.GetAssembly(u.Name));
}

View File

@@ -62,6 +62,9 @@ public abstract class AppAuthorizeHandler : IAuthorizationHandler
// 处理规范化结果
await UnifyWrapper(httpContext, exception);
// 终止响应体被二次写入
await httpContext.Response.CompleteAsync();
}
}
@@ -165,8 +168,9 @@ public abstract class AppAuthorizeHandler : IAuthorizationHandler
Exception = exception
}), out var data);
// 终止返回
// 设置响应状态码
httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError;
await httpContext.Response.WriteAsJsonAsync(data, App.GetOptions<JsonOptions>()?.JsonSerializerOptions);
}
else throw exception;

View File

@@ -23,7 +23,10 @@
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。
// ------------------------------------------------------------------------
using Furion.ClayObject;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Furion.EventBus;
@@ -71,4 +74,30 @@ public abstract class EventHandlerContext
/// </summary>
/// <remarks><remarks>如果是动态订阅,可能为 null</remarks></remarks>
public EventSubscribeAttribute Attribute { get; }
/// <summary>
/// 获取负载数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public T GetPayload<T>()
{
var rawPayload = Source.Payload;
if (rawPayload is null)
{
return default;
}
else if (rawPayload is JsonElement jsonElement)
{
return JsonSerializer.Deserialize<T>(jsonElement.GetRawText(), new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
}
else
{
return (T)rawPayload;
}
}
}

View File

@@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -35,6 +35,28 @@ namespace Furion.JsonSerialization;
[SuppressSniffer]
public class NewtonsoftJsonClayJsonConverter : JsonConverter<Clay>
{
/// <summary>
/// 构造函数
/// </summary>
public NewtonsoftJsonClayJsonConverter()
: this(true)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="toCamelCaseKey"></param>
public NewtonsoftJsonClayJsonConverter(bool toCamelCaseKey)
{
ToCamelCaseKey = toCamelCaseKey;
}
/// <summary>
/// 输出键小写
/// </summary>
public bool ToCamelCaseKey { get; set; } = true;
/// <summary>
/// 反序列化
/// </summary>
@@ -58,6 +80,44 @@ public class NewtonsoftJsonClayJsonConverter : JsonConverter<Clay>
/// <param name="serializer"></param>
public override void WriteJson(JsonWriter writer, Clay value, JsonSerializer serializer)
{
writer.WriteRawValue(value.ToString());
var json = value.ToString();
if (ToCamelCaseKey)
{
writer.WriteRawValue(ConvertKeysToCamelCase(JToken.Parse(json)).ToString());
}
else
{
writer.WriteRawValue(json);
}
}
/// <summary>
/// 转换 Key 为小写
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
private static JToken ConvertKeysToCamelCase(JToken token)
{
if (token is JObject jObj)
{
var newJObject = new JObject();
foreach (var prop in jObj.Properties())
{
var newKey = char.ToLower(prop.Name[0]) + prop.Name.Substring(1);
newJObject[newKey] = ConvertKeysToCamelCase(prop.Value);
}
return newJObject;
}
else if (token is JArray jArray)
{
var newArray = new JArray();
foreach (var item in jArray)
{
newArray.Add(ConvertKeysToCamelCase(item));
}
return newArray;
}
return token;
}
}

View File

@@ -25,6 +25,7 @@
using Furion.ClayObject;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Furion.JsonSerialization;
@@ -36,12 +37,27 @@ namespace Furion.JsonSerialization;
public class SystemTextJsonClayJsonConverter : JsonConverter<Clay>
{
/// <summary>
/// 默认构造函数
/// 构造函数
/// </summary>
public SystemTextJsonClayJsonConverter()
: this(true)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="toCamelCaseKey"></param>
public SystemTextJsonClayJsonConverter(bool toCamelCaseKey)
{
ToCamelCaseKey = toCamelCaseKey;
}
/// <summary>
/// 输出键小写
/// </summary>
public bool ToCamelCaseKey { get; set; } = true;
/// <summary>
/// 反序列化
/// </summary>
@@ -62,6 +78,49 @@ public class SystemTextJsonClayJsonConverter : JsonConverter<Clay>
/// <param name="options"></param>
public override void Write(Utf8JsonWriter writer, Clay value, JsonSerializerOptions options)
{
writer.WriteRawValue(value.ToString());
var json = value.ToString();
if (ToCamelCaseKey)
{
writer.WriteRawValue(ConvertKeysToCamelCase(JsonNode.Parse(json)).ToString());
}
else
{
writer.WriteRawValue(json);
}
}
/// <summary>
/// 转换 Key 为小写
/// </summary>
/// <param name="node"></param>
/// <returns></returns>
private static JsonNode ConvertKeysToCamelCase(JsonNode node)
{
if (node is JsonObject obj)
{
var newObj = new JsonObject();
foreach (var prop in obj)
{
var newKey = char.ToLower(prop.Key[0]) + prop.Key.Substring(1);
newObj[newKey] = DeepCopy(ConvertKeysToCamelCase(prop.Value));
}
return newObj;
}
else if (node is JsonArray array)
{
var newArray = new JsonArray();
foreach (var item in array)
{
newArray.Add(DeepCopy(ConvertKeysToCamelCase(item)));
}
return newArray;
}
return node;
}
private static JsonNode DeepCopy(JsonNode node)
{
return JsonSerializer.Deserialize<JsonNode>(node.ToJsonString());
}
}

View File

@@ -56,7 +56,7 @@ public static class NewtonsoftJsonExtensions
/// </summary>
/// <param name="converters"></param>
/// <param name="overMaxLengthOf17">是否超过最大长度 17 再处理</param>
/// <remarks></remarks>
/// <returns></returns>
public static IList<JsonConverter> AddLongTypeConverters(this IList<JsonConverter> converters, bool overMaxLengthOf17 = false)
{
converters.Add(new NewtonsoftJsonLongToStringJsonConverter(overMaxLengthOf17));
@@ -68,10 +68,12 @@ public static class NewtonsoftJsonExtensions
/// <summary>
/// 添加 Clay 类型序列化处理
/// </summary>
/// <remarks></remarks>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters)
/// <param name="converters"></param>
/// <param name="toCamelCaseKey">输出键小写</param>
/// <returns></returns>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters, bool toCamelCaseKey = true)
{
converters.Add(new NewtonsoftJsonClayJsonConverter());
converters.Add(new NewtonsoftJsonClayJsonConverter(toCamelCaseKey));
return converters;
}

View File

@@ -57,7 +57,7 @@ public static class SystemTextJsonExtensions
/// </summary>
/// <param name="converters"></param>
/// <param name="overMaxLengthOf17">是否超过最大长度 17 再处理</param>
/// <remarks></remarks>
/// <returns></returns>
public static IList<JsonConverter> AddLongTypeConverters(this IList<JsonConverter> converters, bool overMaxLengthOf17 = false)
{
converters.Add(new SystemTextJsonLongToStringJsonConverter(overMaxLengthOf17));
@@ -69,10 +69,12 @@ public static class SystemTextJsonExtensions
/// <summary>
/// 添加 Clay 类型序列化处理
/// </summary>
/// <remarks></remarks>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters)
/// <param name="converters"></param>
/// <param name="toCamelCaseKey">输出键小写</param>
/// <returns></returns>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters, bool toCamelCaseKey = true)
{
converters.Add(new SystemTextJsonClayJsonConverter());
converters.Add(new SystemTextJsonClayJsonConverter(toCamelCaseKey));
return converters;
}

View File

@@ -533,6 +533,15 @@ public sealed class LoggingMonitorAttribute : Attribute, IAsyncActionFilter, IAs
writer.WriteString("type", exceptionTypeName);
writer.WriteString("message", exception.Message);
writer.WriteString("stackTrace", exception.StackTrace?.ToString());
// 添加更多信息
if (exception is AppFriendlyException friendlyException)
{
writer.WriteString("errorCode", friendlyException.ErrorCode?.ToString());
writer.WriteString("originErrorCode", friendlyException.OriginErrorCode?.ToString());
writer.WriteString("statusCode", friendlyException.StatusCode.ToString());
}
writer.WriteEndObject();
writer.WritePropertyName("validation");
@@ -557,6 +566,7 @@ public sealed class LoggingMonitorAttribute : Attribute, IAsyncActionFilter, IAs
writer.WriteString("errorCode", friendlyException?.ErrorCode?.ToString());
writer.WriteString("originErrorCode", friendlyException?.OriginErrorCode?.ToString());
writer.WriteString("message", friendlyException?.Message);
writer.WriteString("statusCode", friendlyException?.StatusCode.ToString());
writer.WriteEndObject();
}

View File

@@ -182,7 +182,12 @@ public sealed partial class HttpRequestPart
/// <returns></returns>
public HttpRequestPart SetBaseAddress(string baseAddress)
{
if (!string.IsNullOrWhiteSpace(baseAddress)) BaseAddress = baseAddress;
if (!string.IsNullOrWhiteSpace(baseAddress))
{
// 支持读取配置渲染
BaseAddress = baseAddress.Render();
}
return this;
}

View File

@@ -228,8 +228,8 @@
spec: {
wrapSelectors: {
taggedOperations: function taggedOperations(ori) {
return function () {
return ori.apply(void 0, arguments).filter(function (tagMeta) {
return function() {
return ori.apply(void 0, arguments).filter(function(tagMeta) {
return tagMeta.get("operations") && tagMeta.get("operations").size > 0;
});
};
@@ -293,13 +293,13 @@
// send ajax request
function sendRequest(params) {
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
let obj = JSON.parse(xhr.response);
let headers = xhr.getAllResponseHeaders();
let arr = headers.trim().split(/[\r\n]+/);
let headerMap = {};
arr.forEach(function (line) {
arr.forEach(function(line) {
let parts = line.split(': ');
let header = parts.shift();
let value = parts.join(': ');
@@ -315,7 +315,7 @@
function objectToString(obj) {
let arr = [];
for (var k in obj) {
arr.push(`${k}=${obj[k]}`);
arr.push(`${k}=${encodeURIComponent(obj[k])}`);
}
return arr.join('&');
@@ -343,7 +343,7 @@
// init swagger ui
function initSwaggerUI(configObject, oauthConfigObject) {
configObject.onComplete = function () {
configObject.onComplete = function() {
var accessToken = window.localStorage.getItem(tokenKey);
if (accessToken) {
ui.preauthorizeApiKey("Bearer", accessToken);
@@ -351,7 +351,7 @@
};
// Workaround for https://github.com/swagger-api/swagger-ui/issues/5945
configObject.urls.forEach(function (item) {
configObject.urls.forEach(function(item) {
if (item.url.startsWith("http") || item.url.startsWith("/")) return;
item.url = window.location.href.replace("index.html", item.url).split('#')[0];
});
@@ -387,7 +387,7 @@
window.ui = ui
}
window.onload = function () {
window.onload = function() {
var configObject = JSON.parse('%(ConfigObject)');
var oauthConfigObject = JSON.parse('%(OAuthConfigObject)');
@@ -403,7 +403,7 @@
sendRequest({
method: "POST",
url: loginObject.CheckUrl,
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -411,7 +411,7 @@
else {
userName.focus();
submit.addEventListener("click", function (ev) {
submit.addEventListener("click", function(ev) {
if (userName.value.trim().length === 0) {
userName.focus();
return;
@@ -430,7 +430,7 @@
userName: userName.value.trim(),
password: password.value.trim()
},
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -440,7 +440,7 @@
loginError.innerHTML = "Invalid UserName or Password.";
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.SubmitUrl;
}
@@ -452,7 +452,7 @@
});
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.CheckUrl;
}

View File

@@ -227,8 +227,8 @@
spec: {
wrapSelectors: {
taggedOperations: function taggedOperations(ori) {
return function () {
return ori.apply(void 0, arguments).filter(function (tagMeta) {
return function() {
return ori.apply(void 0, arguments).filter(function(tagMeta) {
return tagMeta.get("operations") && tagMeta.get("operations").size > 0;
});
};
@@ -292,13 +292,13 @@
// send ajax request
function sendRequest(params) {
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
let obj = JSON.parse(xhr.response);
let headers = xhr.getAllResponseHeaders();
let arr = headers.trim().split(/[\r\n]+/);
let headerMap = {};
arr.forEach(function (line) {
arr.forEach(function(line) {
let parts = line.split(': ');
let header = parts.shift();
let value = parts.join(': ');
@@ -314,7 +314,7 @@
function objectToString(obj) {
let arr = [];
for (var k in obj) {
arr.push(`${k}=${obj[k]}`);
arr.push(`${k}=${encodeURIComponent(obj[k])}`);
}
return arr.join('&');
@@ -342,7 +342,7 @@
// init swagger ui
function initSwaggerUI(configObject, oauthConfigObject) {
configObject.onComplete = function () {
configObject.onComplete = function() {
var accessToken = window.localStorage.getItem(tokenKey);
if (accessToken) {
ui.preauthorizeApiKey("Bearer", accessToken);
@@ -350,7 +350,7 @@
};
// Workaround for https://github.com/swagger-api/swagger-ui/issues/5945
configObject.urls.forEach(function (item) {
configObject.urls.forEach(function(item) {
if (item.url.startsWith("http") || item.url.startsWith("/")) return;
item.url = window.location.href.replace("index.html", item.url).split('#')[0];
});
@@ -386,7 +386,7 @@
window.ui = ui
}
window.onload = function () {
window.onload = function() {
var configObject = JSON.parse('%(ConfigObject)');
var oauthConfigObject = JSON.parse('%(OAuthConfigObject)');
@@ -402,7 +402,7 @@
sendRequest({
method: "POST",
url: loginObject.CheckUrl,
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -410,7 +410,7 @@
else {
userName.focus();
submit.addEventListener("click", function (ev) {
submit.addEventListener("click", function(ev) {
if (userName.value.trim().length === 0) {
userName.focus();
return;
@@ -429,7 +429,7 @@
userName: userName.value.trim(),
password: password.value.trim()
},
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -439,7 +439,7 @@
loginError.innerHTML = "Invalid UserName or Password.";
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.SubmitUrl;
}
@@ -451,7 +451,7 @@
});
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.CheckUrl;
}

View File

@@ -531,7 +531,7 @@ public static class App
scanAssemblies = dependencyContext.RuntimeLibraries
.Where(u =>
(u.Type == "project" && !excludeAssemblyNames.Any(j => u.Name.EndsWith(j))) ||
(u.Type == "package" && (u.Name.StartsWith(nameof(Furion)) || supportPackageNamePrefixs.Any(p => u.Name.StartsWith(p)))) ||
(u.Type == "package" && (u.Name.StartsWith(nameof(Furion)) || supportPackageNamePrefixs.Any(p => u.Name.StartsWith(p) && u.RuntimeAssemblyGroups.Count > 0))) ||
(Settings.EnabledReferenceAssemblyScan == true && u.Type == "reference")) // 判断是否启用引用程序集扫描
.Select(u => Reflect.GetAssembly(u.Name));
}

View File

@@ -62,6 +62,9 @@ public abstract class AppAuthorizeHandler : IAuthorizationHandler
// 处理规范化结果
await UnifyWrapper(httpContext, exception);
// 终止响应体被二次写入
await httpContext.Response.CompleteAsync();
}
}
@@ -165,8 +168,9 @@ public abstract class AppAuthorizeHandler : IAuthorizationHandler
Exception = exception
}), out var data);
// 终止返回
// 设置响应状态码
httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError;
await httpContext.Response.WriteAsJsonAsync(data, App.GetOptions<JsonOptions>()?.JsonSerializerOptions);
}
else throw exception;

View File

@@ -310,7 +310,7 @@ public static class DatabaseProviderServiceCollectionExtensions
{
var optionsType = options.GetType();
optionsType.GetMethod("MigrationsAssembly")
optionsType.GetMethods(BindingFlags.Instance | BindingFlags.Public).FirstOrDefault(u => u.Name == "MigrationsAssembly" && u.GetParameters().Length == 1 && u.GetParameters().First().ParameterType == typeof(string))
.Invoke(options, new[] { Db.MigrationAssemblyName });
// 解决 MySQL/SqlServer/PostgreSQL 有时候出现短暂连接失败问题v4.8.1.7 版本关闭)

View File

@@ -54,6 +54,21 @@ public partial interface IDeletableRepository<TEntity, TDbContextLocator> : IPri
public interface IPrivateDeletableRepository<TEntity> : IPrivateRootRepository
where TEntity : class, IPrivateEntity, new()
{
/// <summary>
/// 根据主键分表删除记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="keys"></param>
void DeleteFromSegments(Func<string, IEnumerable<string>> tableNamesAction, params object[] keys);
/// <summary>
/// 根据主键分表删除记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="keys"></param>
/// <returns></returns>
Task DeleteFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, params object[] keys);
/// <summary>
/// 删除一条记录
/// </summary>

View File

@@ -60,8 +60,7 @@ public interface IPrivateInsertableRepository<TEntity> : IPrivateRootRepository
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="keySet"></param>
/// <returns></returns>
EntityEntry<TEntity> InsertFromSegments(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null);
void InsertFromSegments(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null);
/// <summary>
/// 分表插入一条记录
@@ -69,8 +68,7 @@ public interface IPrivateInsertableRepository<TEntity> : IPrivateRootRepository
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="keySet"></param>
/// <returns></returns>
Task<EntityEntry<TEntity>> InsertFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null);
Task InsertFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null);
/// <summary>
/// 新增一条记录

View File

@@ -55,6 +55,25 @@ public partial interface IUpdateableRepository<TEntity, TDbContextLocator> : IPr
public partial interface IPrivateUpdateableRepository<TEntity> : IPrivateRootRepository
where TEntity : class, IPrivateEntity, new()
{
/// <summary>
/// 分表更新一条记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="includePropertyNames"></param>
/// <param name="excludePropertyNames"></param>
void UpdateFromSegments(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, string[] includePropertyNames = null, string[] excludePropertyNames = null);
/// <summary>
/// 分表更新一条记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="includePropertyNames"></param>
/// <param name="excludePropertyNames"></param>
/// <returns></returns>
Task UpdateFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, string[] includePropertyNames = null, string[] excludePropertyNames = null);
/// <summary>
/// 更新一条记录
/// </summary>

View File

@@ -25,6 +25,8 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Metadata;
using System.Text;
namespace Furion.DatabaseAccessor;
@@ -34,6 +36,41 @@ namespace Furion.DatabaseAccessor;
public partial class PrivateRepository<TEntity>
where TEntity : class, IPrivateEntity, new()
{
/// <summary>
/// 根据主键分表删除记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="keys"></param>
public virtual void DeleteFromSegments(Func<string, IEnumerable<string>> tableNamesAction, params object[] keys)
{
if (keys == null || keys.Length == 0)
{
return;
}
GenerateDeleteSQL(tableNamesAction, keys, out var stringBuilder);
Database.ExecuteSqlRaw(stringBuilder.ToString(), keys);
}
/// <summary>
/// 根据主键分表删除记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="keys"></param>
/// <returns></returns>
public virtual async Task DeleteFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, params object[] keys)
{
if (keys == null || keys.Length == 0)
{
return;
}
GenerateDeleteSQL(tableNamesAction, keys, out var stringBuilder);
await Database.ExecuteSqlRawAsync(stringBuilder.ToString(), keys);
}
/// <summary>
/// 删除一条记录
/// </summary>
@@ -356,4 +393,56 @@ public partial class PrivateRepository<TEntity>
return entity;
}
/// <summary>
/// 生成 Delete 语句
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="keys"></param>
/// <param name="stringBuilder"></param>
/// <exception cref="ArgumentNullException"></exception>
private void GenerateDeleteSQL(Func<string, IEnumerable<string>> tableNamesAction
, object[] keys
, out StringBuilder stringBuilder)
{
if (tableNamesAction == null)
{
throw new ArgumentNullException(nameof(tableNamesAction));
}
// 原始表
var originTableName = GetFullTableName();
// 获取分表名称集合
var returnTableNames = tableNamesAction(originTableName)?.ToArray();
var tableSegments = ((returnTableNames == null || returnTableNames.Length == 0) ? [originTableName] : returnTableNames)
.Distinct()
.Select(u => string.IsNullOrWhiteSpace(u) ? originTableName : FormatDbElement(u));
// 获取主键属性
var columnProperty = EntityType.FindPrimaryKey().Properties
.FirstOrDefault();
// 查询主键列名
var keyColumn = FormatDbElement(columnProperty?.GetColumnName(StoreObjectIdentifier.Table(EntityType?.GetTableName(), EntityType?.GetSchema())));
var keyInStringBuilder = new StringBuilder();
for (var i = 0; i < keys.Length; i++)
{
keyInStringBuilder.Append($"{{{i}}}");
if (i != keys.Length - 1)
{
keyInStringBuilder.Append(", ");
}
}
stringBuilder = new StringBuilder();
// 生成删除语句
foreach (var tableName in returnTableNames)
{
stringBuilder.AppendLine($"DELETE FROM {tableName} WHERE {keyColumn} IN ({keyInStringBuilder});");
}
}
}

View File

@@ -42,15 +42,11 @@ public partial class PrivateRepository<TEntity>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="keySet"></param>
/// <returns></returns>
public virtual EntityEntry<TEntity> InsertFromSegments(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null)
public virtual void InsertFromSegments(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null)
{
GenerateInsertSQL(tableNamesAction, entity, out var stringBuilder, out var parameters, keySet);
// 这里怎么根据将 stringBuilder 和 entity 关联起来
Database.ExecuteSqlRaw(stringBuilder.ToString(), parameters.ToArray());
return Context.Entry(entity);
}
/// <summary>
@@ -59,15 +55,11 @@ public partial class PrivateRepository<TEntity>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="keySet"></param>
/// <returns></returns>
public virtual async Task<EntityEntry<TEntity>> InsertFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null)
public virtual async Task InsertFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, object keySet = null)
{
GenerateInsertSQL(tableNamesAction, entity, out var stringBuilder, out var parameters, keySet);
// 这里怎么根据将 stringBuilder 和 entity 关联起来
await Database.ExecuteSqlRawAsync(stringBuilder.ToString(), parameters.ToArray());
return Context.Entry(entity);
}
/// <summary>

View File

@@ -25,7 +25,9 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Metadata;
using System.Linq.Expressions;
using System.Text;
namespace Furion.DatabaseAccessor;
@@ -35,6 +37,35 @@ namespace Furion.DatabaseAccessor;
public partial class PrivateRepository<TEntity>
where TEntity : class, IPrivateEntity, new()
{
/// <summary>
/// 分表更新一条记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="includePropertyNames"></param>
/// <param name="excludePropertyNames"></param>
public virtual void UpdateFromSegments(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, string[] includePropertyNames = null, string[] excludePropertyNames = null)
{
GenerateUpdateSQL(tableNamesAction, entity, out var stringBuilder, out var parameters, includePropertyNames, excludePropertyNames);
Database.ExecuteSqlRaw(stringBuilder.ToString(), parameters.ToArray());
}
/// <summary>
/// 分表更新一条记录
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="includePropertyNames"></param>
/// <param name="excludePropertyNames"></param>
/// <returns></returns>
public virtual async Task UpdateFromSegmentsAsync(Func<string, IEnumerable<string>> tableNamesAction, TEntity entity, string[] includePropertyNames = null, string[] excludePropertyNames = null)
{
GenerateUpdateSQL(tableNamesAction, entity, out var stringBuilder, out var parameters, includePropertyNames, excludePropertyNames);
await Database.ExecuteSqlRawAsync(stringBuilder.ToString(), parameters.ToArray());
}
/// <summary>
/// 更新一条记录
/// </summary>
@@ -1084,4 +1115,104 @@ public partial class PrivateRepository<TEntity>
}
}
}
/// <summary>
/// 生成 UPDATE 语句
/// </summary>
/// <param name="tableNamesAction"></param>
/// <param name="entity"></param>
/// <param name="stringBuilder"></param>
/// <param name="parameters"></param>
/// <param name="includePropertyNames"></param>
/// <param name="excludePropertyNames"></param>
/// <exception cref="ArgumentNullException"></exception>
private void GenerateUpdateSQL(Func<string, IEnumerable<string>> tableNamesAction
, TEntity entity
, out StringBuilder stringBuilder
, out List<object> parameters
, string[] includePropertyNames = null
, string[] excludePropertyNames = null)
{
if (tableNamesAction == null)
{
throw new ArgumentNullException(nameof(tableNamesAction));
}
// 原始表
var originTableName = GetFullTableName();
// 获取分表名称集合
var returnTableNames = tableNamesAction(originTableName)?.ToArray();
var tableSegments = ((returnTableNames == null || returnTableNames.Length == 0) ? [originTableName] : returnTableNames)
.Distinct()
.Select(u => string.IsNullOrWhiteSpace(u) ? originTableName : FormatDbElement(u));
// 获取主键属性
var columnProperty = EntityType.FindPrimaryKey().Properties
.FirstOrDefault();
var columnPropertyValue = Entry(entity).Property(columnProperty.Name).CurrentValue;
if (columnPropertyValue == null)
{
throw new InvalidOperationException("No definition of the primary key found.");
}
// 查询主键列名
var keyColumn = FormatDbElement(columnProperty?.GetColumnName(StoreObjectIdentifier.Table(EntityType?.GetTableName(), EntityType?.GetSchema())));
// 获取列名
var columnNames = EntityType.GetProperties()
.ToDictionary(p => p.Name, p => FormatDbElement(p.GetColumnName(StoreObjectIdentifier.Table(EntityType?.GetTableName(), EntityType?.GetSchema()))))
.Where(u => !u.Value.Equals(keyColumn, StringComparison.OrdinalIgnoreCase))
.ToDictionary(p => p.Key, p => p.Value);
var setColumnStringBuilder = new StringBuilder();
parameters = new();
var i = 0;
var j = 0;
foreach (var (key, value) in columnNames)
{
j++;
var canUpdate = true;
if (includePropertyNames is { Length: > 0 })
{
canUpdate = includePropertyNames.Contains(key, StringComparer.OrdinalIgnoreCase);
}
else if (excludePropertyNames is { Length: > 0 })
{
if (excludePropertyNames.Contains(key, StringComparer.OrdinalIgnoreCase))
{
canUpdate = false;
}
}
if (canUpdate)
{
setColumnStringBuilder.Append($"\"{key}\" = {{{i}}}");
if (j < columnNames.Count)
{
setColumnStringBuilder.Append(", ");
}
var propertyValue = Entry(entity).Property(key).CurrentValue;
parameters.Add(propertyValue);
i++;
}
}
parameters.Add(columnPropertyValue);
stringBuilder = new StringBuilder();
// 生成更新语句
foreach (var tableName in returnTableNames)
{
stringBuilder.AppendLine($"UPDATE {tableName} SET {setColumnStringBuilder} WHERE {keyColumn} = {{{i}}};");
}
}
}

View File

@@ -23,7 +23,10 @@
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。
// ------------------------------------------------------------------------
using Furion.ClayObject;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Furion.EventBus;
@@ -71,4 +74,30 @@ public abstract class EventHandlerContext
/// </summary>
/// <remarks><remarks>如果是动态订阅,可能为 null</remarks></remarks>
public EventSubscribeAttribute Attribute { get; }
/// <summary>
/// 获取负载数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public T GetPayload<T>()
{
var rawPayload = Source.Payload;
if (rawPayload is null)
{
return default;
}
else if (rawPayload is JsonElement jsonElement)
{
return JsonSerializer.Deserialize<T>(jsonElement.GetRawText(), new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
}
else
{
return (T)rawPayload;
}
}
}

View File

@@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -35,6 +35,28 @@ namespace Furion.JsonSerialization;
[SuppressSniffer]
public class NewtonsoftJsonClayJsonConverter : JsonConverter<Clay>
{
/// <summary>
/// 构造函数
/// </summary>
public NewtonsoftJsonClayJsonConverter()
: this(true)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="toCamelCaseKey"></param>
public NewtonsoftJsonClayJsonConverter(bool toCamelCaseKey)
{
ToCamelCaseKey = toCamelCaseKey;
}
/// <summary>
/// 输出键小写
/// </summary>
public bool ToCamelCaseKey { get; set; } = true;
/// <summary>
/// 反序列化
/// </summary>
@@ -58,6 +80,44 @@ public class NewtonsoftJsonClayJsonConverter : JsonConverter<Clay>
/// <param name="serializer"></param>
public override void WriteJson(JsonWriter writer, Clay value, JsonSerializer serializer)
{
writer.WriteRawValue(value.ToString());
var json = value.ToString();
if (ToCamelCaseKey)
{
writer.WriteRawValue(ConvertKeysToCamelCase(JToken.Parse(json)).ToString());
}
else
{
writer.WriteRawValue(json);
}
}
/// <summary>
/// 转换 Key 为小写
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
private static JToken ConvertKeysToCamelCase(JToken token)
{
if (token is JObject jObj)
{
var newJObject = new JObject();
foreach (var prop in jObj.Properties())
{
var newKey = char.ToLower(prop.Name[0]) + prop.Name.Substring(1);
newJObject[newKey] = ConvertKeysToCamelCase(prop.Value);
}
return newJObject;
}
else if (token is JArray jArray)
{
var newArray = new JArray();
foreach (var item in jArray)
{
newArray.Add(ConvertKeysToCamelCase(item));
}
return newArray;
}
return token;
}
}

View File

@@ -25,6 +25,7 @@
using Furion.ClayObject;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Furion.JsonSerialization;
@@ -36,12 +37,27 @@ namespace Furion.JsonSerialization;
public class SystemTextJsonClayJsonConverter : JsonConverter<Clay>
{
/// <summary>
/// 默认构造函数
/// 构造函数
/// </summary>
public SystemTextJsonClayJsonConverter()
: this(true)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="toCamelCaseKey"></param>
public SystemTextJsonClayJsonConverter(bool toCamelCaseKey)
{
ToCamelCaseKey = toCamelCaseKey;
}
/// <summary>
/// 输出键小写
/// </summary>
public bool ToCamelCaseKey { get; set; } = true;
/// <summary>
/// 反序列化
/// </summary>
@@ -62,6 +78,49 @@ public class SystemTextJsonClayJsonConverter : JsonConverter<Clay>
/// <param name="options"></param>
public override void Write(Utf8JsonWriter writer, Clay value, JsonSerializerOptions options)
{
writer.WriteRawValue(value.ToString());
var json = value.ToString();
if (ToCamelCaseKey)
{
writer.WriteRawValue(ConvertKeysToCamelCase(JsonNode.Parse(json)).ToString());
}
else
{
writer.WriteRawValue(json);
}
}
/// <summary>
/// 转换 Key 为小写
/// </summary>
/// <param name="node"></param>
/// <returns></returns>
private static JsonNode ConvertKeysToCamelCase(JsonNode node)
{
if (node is JsonObject obj)
{
var newObj = new JsonObject();
foreach (var prop in obj)
{
var newKey = char.ToLower(prop.Key[0]) + prop.Key.Substring(1);
newObj[newKey] = DeepCopy(ConvertKeysToCamelCase(prop.Value));
}
return newObj;
}
else if (node is JsonArray array)
{
var newArray = new JsonArray();
foreach (var item in array)
{
newArray.Add(DeepCopy(ConvertKeysToCamelCase(item)));
}
return newArray;
}
return node;
}
private static JsonNode DeepCopy(JsonNode node)
{
return JsonSerializer.Deserialize<JsonNode>(node.ToJsonString());
}
}

View File

@@ -56,7 +56,7 @@ public static class NewtonsoftJsonExtensions
/// </summary>
/// <param name="converters"></param>
/// <param name="overMaxLengthOf17">是否超过最大长度 17 再处理</param>
/// <remarks></remarks>
/// <returns></returns>
public static IList<JsonConverter> AddLongTypeConverters(this IList<JsonConverter> converters, bool overMaxLengthOf17 = false)
{
converters.Add(new NewtonsoftJsonLongToStringJsonConverter(overMaxLengthOf17));
@@ -68,10 +68,12 @@ public static class NewtonsoftJsonExtensions
/// <summary>
/// 添加 Clay 类型序列化处理
/// </summary>
/// <remarks></remarks>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters)
/// <param name="converters"></param>
/// <param name="toCamelCaseKey">输出键小写</param>
/// <returns></returns>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters, bool toCamelCaseKey = true)
{
converters.Add(new NewtonsoftJsonClayJsonConverter());
converters.Add(new NewtonsoftJsonClayJsonConverter(toCamelCaseKey));
return converters;
}

View File

@@ -57,7 +57,7 @@ public static class SystemTextJsonExtensions
/// </summary>
/// <param name="converters"></param>
/// <param name="overMaxLengthOf17">是否超过最大长度 17 再处理</param>
/// <remarks></remarks>
/// <returns></returns>
public static IList<JsonConverter> AddLongTypeConverters(this IList<JsonConverter> converters, bool overMaxLengthOf17 = false)
{
converters.Add(new SystemTextJsonLongToStringJsonConverter(overMaxLengthOf17));
@@ -69,10 +69,12 @@ public static class SystemTextJsonExtensions
/// <summary>
/// 添加 Clay 类型序列化处理
/// </summary>
/// <remarks></remarks>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters)
/// <param name="converters"></param>
/// <param name="toCamelCaseKey">输出键小写</param>
/// <returns></returns>
public static IList<JsonConverter> AddClayConverters(this IList<JsonConverter> converters, bool toCamelCaseKey = true)
{
converters.Add(new SystemTextJsonClayJsonConverter());
converters.Add(new SystemTextJsonClayJsonConverter(toCamelCaseKey));
return converters;
}

View File

@@ -533,6 +533,15 @@ public sealed class LoggingMonitorAttribute : Attribute, IAsyncActionFilter, IAs
writer.WriteString("type", exceptionTypeName);
writer.WriteString("message", exception.Message);
writer.WriteString("stackTrace", exception.StackTrace?.ToString());
// 添加更多信息
if (exception is AppFriendlyException friendlyException)
{
writer.WriteString("errorCode", friendlyException.ErrorCode?.ToString());
writer.WriteString("originErrorCode", friendlyException.OriginErrorCode?.ToString());
writer.WriteString("statusCode", friendlyException.StatusCode.ToString());
}
writer.WriteEndObject();
writer.WritePropertyName("validation");
@@ -557,6 +566,7 @@ public sealed class LoggingMonitorAttribute : Attribute, IAsyncActionFilter, IAs
writer.WriteString("errorCode", friendlyException?.ErrorCode?.ToString());
writer.WriteString("originErrorCode", friendlyException?.OriginErrorCode?.ToString());
writer.WriteString("message", friendlyException?.Message);
writer.WriteString("statusCode", friendlyException?.StatusCode.ToString());
writer.WriteEndObject();
}

View File

@@ -182,7 +182,12 @@ public sealed partial class HttpRequestPart
/// <returns></returns>
public HttpRequestPart SetBaseAddress(string baseAddress)
{
if (!string.IsNullOrWhiteSpace(baseAddress)) BaseAddress = baseAddress;
if (!string.IsNullOrWhiteSpace(baseAddress))
{
// 支持读取配置渲染
BaseAddress = baseAddress.Render();
}
return this;
}

View File

@@ -228,8 +228,8 @@
spec: {
wrapSelectors: {
taggedOperations: function taggedOperations(ori) {
return function () {
return ori.apply(void 0, arguments).filter(function (tagMeta) {
return function() {
return ori.apply(void 0, arguments).filter(function(tagMeta) {
return tagMeta.get("operations") && tagMeta.get("operations").size > 0;
});
};
@@ -293,13 +293,13 @@
// send ajax request
function sendRequest(params) {
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
let obj = JSON.parse(xhr.response);
let headers = xhr.getAllResponseHeaders();
let arr = headers.trim().split(/[\r\n]+/);
let headerMap = {};
arr.forEach(function (line) {
arr.forEach(function(line) {
let parts = line.split(': ');
let header = parts.shift();
let value = parts.join(': ');
@@ -315,7 +315,7 @@
function objectToString(obj) {
let arr = [];
for (var k in obj) {
arr.push(`${k}=${obj[k]}`);
arr.push(`${k}=${encodeURIComponent(obj[k])}`);
}
return arr.join('&');
@@ -343,7 +343,7 @@
// init swagger ui
function initSwaggerUI(configObject, oauthConfigObject) {
configObject.onComplete = function () {
configObject.onComplete = function() {
var accessToken = window.localStorage.getItem(tokenKey);
if (accessToken) {
ui.preauthorizeApiKey("Bearer", accessToken);
@@ -351,7 +351,7 @@
};
// Workaround for https://github.com/swagger-api/swagger-ui/issues/5945
configObject.urls.forEach(function (item) {
configObject.urls.forEach(function(item) {
if (item.url.startsWith("http") || item.url.startsWith("/")) return;
item.url = window.location.href.replace("index.html", item.url).split('#')[0];
});
@@ -387,7 +387,7 @@
window.ui = ui
}
window.onload = function () {
window.onload = function() {
var configObject = JSON.parse('%(ConfigObject)');
var oauthConfigObject = JSON.parse('%(OAuthConfigObject)');
@@ -403,7 +403,7 @@
sendRequest({
method: "POST",
url: loginObject.CheckUrl,
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -411,7 +411,7 @@
else {
userName.focus();
submit.addEventListener("click", function (ev) {
submit.addEventListener("click", function(ev) {
if (userName.value.trim().length === 0) {
userName.focus();
return;
@@ -430,7 +430,7 @@
userName: userName.value.trim(),
password: password.value.trim()
},
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -440,7 +440,7 @@
loginError.innerHTML = "Invalid UserName or Password.";
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.SubmitUrl;
}
@@ -452,7 +452,7 @@
});
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.CheckUrl;
}

View File

@@ -227,8 +227,8 @@
spec: {
wrapSelectors: {
taggedOperations: function taggedOperations(ori) {
return function () {
return ori.apply(void 0, arguments).filter(function (tagMeta) {
return function() {
return ori.apply(void 0, arguments).filter(function(tagMeta) {
return tagMeta.get("operations") && tagMeta.get("operations").size > 0;
});
};
@@ -292,13 +292,13 @@
// send ajax request
function sendRequest(params) {
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
let obj = JSON.parse(xhr.response);
let headers = xhr.getAllResponseHeaders();
let arr = headers.trim().split(/[\r\n]+/);
let headerMap = {};
arr.forEach(function (line) {
arr.forEach(function(line) {
let parts = line.split(': ');
let header = parts.shift();
let value = parts.join(': ');
@@ -314,7 +314,7 @@
function objectToString(obj) {
let arr = [];
for (var k in obj) {
arr.push(`${k}=${obj[k]}`);
arr.push(`${k}=${encodeURIComponent(obj[k])}`);
}
return arr.join('&');
@@ -342,7 +342,7 @@
// init swagger ui
function initSwaggerUI(configObject, oauthConfigObject) {
configObject.onComplete = function () {
configObject.onComplete = function() {
var accessToken = window.localStorage.getItem(tokenKey);
if (accessToken) {
ui.preauthorizeApiKey("Bearer", accessToken);
@@ -350,7 +350,7 @@
};
// Workaround for https://github.com/swagger-api/swagger-ui/issues/5945
configObject.urls.forEach(function (item) {
configObject.urls.forEach(function(item) {
if (item.url.startsWith("http") || item.url.startsWith("/")) return;
item.url = window.location.href.replace("index.html", item.url).split('#')[0];
});
@@ -386,7 +386,7 @@
window.ui = ui
}
window.onload = function () {
window.onload = function() {
var configObject = JSON.parse('%(ConfigObject)');
var oauthConfigObject = JSON.parse('%(OAuthConfigObject)');
@@ -402,7 +402,7 @@
sendRequest({
method: "POST",
url: loginObject.CheckUrl,
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -410,7 +410,7 @@
else {
userName.focus();
submit.addEventListener("click", function (ev) {
submit.addEventListener("click", function(ev) {
if (userName.value.trim().length === 0) {
userName.focus();
return;
@@ -429,7 +429,7 @@
userName: userName.value.trim(),
password: password.value.trim()
},
success: function (res, headerMap) {
success: function(res, headerMap) {
if (res.toString() === "200") {
loginForm.style.display = "none";
initSwaggerUI(configObject, oauthConfigObject);
@@ -439,7 +439,7 @@
loginError.innerHTML = "Invalid UserName or Password.";
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.SubmitUrl;
}
@@ -451,7 +451,7 @@
});
}
},
error: function (xhr) {
error: function(xhr) {
if (xhr.status === 404) {
loginError.innerHTML = "Not Found: " + loginObject.CheckUrl;
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>Furion.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -355,7 +355,19 @@ public class PersonService : IDynamicApiController
public async Task ()
{
var persons = await _personRepository
.InsertFromSegmentsAsync(table => [table], new Person { Id = 2, Name = "Furion", Age = 32 });
await _personRepository
.InsertFromSegmentsAsync(table => [table], new Person { Id = 2, Name = "Furion", Age = 32 });
}
public async Task ()
{
await _personRepository
.UpdateFromSegmentsAsync(table => [table], new Person { Id = 1, Name = "Furion", Age = 32 });
}
public async Task ()
{
await _personRepository
.DeleteFromSegmentsAsync(table => [table], 1, 2, 3, 4);
}
}

View File

@@ -1,6 +1,7 @@
using Furion.EventBus;
using Furion.Extensitions.EventBus;
using Microsoft.Extensions.Logging;
using System.Text.Json;
namespace Furion.Application;
@@ -24,7 +25,7 @@ public class TestEventBus : IDynamicApiController, IDisposable
// 发布 ToDo:Create 消息
public async Task CreateDoTo()
{
await _eventPublisher.PublishAsync("ToDo:Create");
await _eventPublisher.PublishAsync("ToDo:Create", "Furion");
}
// 发布枚举消息
@@ -93,7 +94,7 @@ public class ToDoEventSubscriber : IEventSubscriber, ISingleton
public async Task CreateToDo(EventHandlerExecutingContext context)
{
var todo = context.Source;
_logger.LogInformation("创建一个 ToDo{Name}", todo.Payload);
_logger.LogInformation("创建一个 ToDo{Name}", context.GetPayload<string>());
await Task.CompletedTask;
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>Furion.Core.xml</DocumentationFile>
</PropertyGroup>
@@ -11,8 +11,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
@@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>Furion.Web.Core.xml</DocumentationFile>
</PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile></DocumentationFile>
@@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -32,6 +32,8 @@
},
"AllowedHosts": "*",
"AppSettings": {
//"EnabledReferenceAssemblyScan": true,
"ExternalAssemblies": [ "", "notfound.dll", "plugins/ClassLibrary1.dll", "plugins/sub" ]
//"SupportPackageNamePrefixs": [ "Swashbuckle" ]
}
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
@@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2792.45" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
</ItemGroup>
<ItemGroup>

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
@@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2792.45" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
</ItemGroup>
<ItemGroup>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.Api</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Api 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -16,6 +16,14 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6",
"description": ".NET6 脚手架"
},
{
"choice": "net7",
"description": ".NET7 脚手架"
},
{
"choice": "net8",
"description": ".NET8 脚手架"
@@ -25,8 +33,16 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"description": "选择要创建的 .NET8-9 脚手架"
"defaultValue": "net9",
"description": "选择要创建的 .NET6-9 脚手架"
},
"net6": {
"type": "computed",
"value": "(framework == \"net6\")"
},
"net7": {
"type": "computed",
"value": "(framework == \"net7\")"
},
"net8": {
"type": "computed",

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApi.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApi.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApi.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApi.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
@@ -17,9 +29,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furion" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApi.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApi.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
@@ -14,15 +28,29 @@
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<ItemGroup Condition="'$(net6)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.36">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net7)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-rc.2.24474.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.App</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Mvc/Api 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -24,6 +24,14 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6",
"description": ".NET6 脚手架"
},
{
"choice": "net7",
"description": ".NET7 脚手架"
},
{
"choice": "net8",
"description": ".NET8 脚手架"
@@ -33,8 +41,16 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"description": "选择要创建的 .NET8-9 脚手架"
"defaultValue": "net9",
"description": "选择要创建的 .NET6-9 脚手架"
},
"net6": {
"type": "computed",
"value": "(framework == \"net6\")"
},
"net7": {
"type": "computed",
"value": "(framework == \"net7\")"
},
"net8": {
"type": "computed",

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApp.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApp.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApp.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApp.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
@@ -17,9 +29,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furion" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApp.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionApp.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
@@ -14,15 +28,29 @@
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<ItemGroup Condition="'$(net6)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.36">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net7)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-rc.2.24474.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.Blazor.App</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Blazor App 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -25,7 +25,7 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"defaultValue": "net9",
"description": "选择要创建的 .NET8-9 脚手架"
},
"net8": {

View File

@@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furion" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
</Project>

View File

@@ -17,11 +17,11 @@
</PropertyGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.11" />
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0-rc.2.24474.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
</ItemGroup>
</Project>

View File

@@ -19,18 +19,18 @@
</ItemGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0-rc.2.24474.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-rc.2.24474.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.Blazor</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Blazor 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -16,6 +16,14 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6",
"description": ".NET6 脚手架"
},
{
"choice": "net7",
"description": ".NET7 脚手架"
},
{
"choice": "net8",
"description": ".NET8 脚手架"
@@ -25,8 +33,16 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"description": "选择要创建的 .NET8-9 脚手架"
"defaultValue": "net9",
"description": "选择要创建的 .NET6-9 脚手架"
},
"net6": {
"type": "computed",
"value": "(framework == \"net6\")"
},
"net7": {
"type": "computed",
"value": "(framework == \"net7\")"
},
"net8": {
"type": "computed",

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
@@ -11,8 +21,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furion" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
@@ -14,15 +28,29 @@
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<ItemGroup Condition="'$(net6)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.36">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net7)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-rc.2.24474.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.BlazorWithWebApi</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Blazor和WebApi 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -16,6 +16,14 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6",
"description": ".NET6 脚手架"
},
{
"choice": "net7",
"description": ".NET7 脚手架"
},
{
"choice": "net8",
"description": ".NET8 脚手架"
@@ -25,8 +33,16 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"description": "选择要创建的 .NET8-9 脚手架"
"defaultValue": "net9",
"description": "选择要创建的 .NET6-9 脚手架"
},
"net6": {
"type": "computed",
"value": "(framework == \"net6\")"
},
"net7": {
"type": "computed",
"value": "(framework == \"net7\")"
},
"net8": {
"type": "computed",

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionBlazorApi.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionBlazorApi.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionBlazorApi.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionBlazorApi.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
@@ -17,9 +29,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furion" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionBlazorApi.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>FurionBlazorApi.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
@@ -14,15 +28,29 @@
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<ItemGroup Condition="'$(net6)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.36">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net7)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-rc.2.24474.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.Mvc</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Mvc 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -16,6 +16,14 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6",
"description": ".NET6 脚手架"
},
{
"choice": "net7",
"description": ".NET7 脚手架"
},
{
"choice": "net8",
"description": ".NET8 脚手架"
@@ -25,8 +33,16 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"description": "选择要创建的 .NET8-9 脚手架"
"defaultValue": "net9",
"description": "选择要创建的 .NET6-9 脚手架"
},
"net6": {
"type": "computed",
"value": "(framework == \"net6\")"
},
"net7": {
"type": "computed",
"value": "(framework == \"net7\")"
},
"net8": {
"type": "computed",

View File

@@ -1,5 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
@@ -11,8 +21,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furion" Version="4.9.5.15" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.15" />
<PackageReference Include="Furion" Version="4.9.5.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.26" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

View File

@@ -1,5 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>

View File

@@ -1,5 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Condition="'$(net6)' == 'True' ">
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net7)' == 'True' ">
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<PropertyGroup Condition="'$(net8)' == 'True' ">
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
@@ -14,15 +28,29 @@
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<ItemGroup Condition="'$(net6)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.36">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net7)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net8)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(net9)' == 'True' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-rc.2.24474.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Furion.Template.Razor</id>
<version>4.9.5.15</version>
<version>4.9.5.26</version>
<description>基于 Furion 框架快速搭建 Razor Pages 多层架构模板。</description>
<authors>百小僧</authors>
<packageTypes>

View File

@@ -16,6 +16,14 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6",
"description": ".NET6 脚手架"
},
{
"choice": "net7",
"description": ".NET7 脚手架"
},
{
"choice": "net8",
"description": ".NET8 脚手架"
@@ -25,8 +33,16 @@
"description": ".NET9 脚手架"
}
],
"defaultValue": "net8",
"description": "选择要创建的 .NET8-9 脚手架"
"defaultValue": "net9",
"description": "选择要创建的 .NET6-9 脚手架"
},
"net6": {
"type": "computed",
"value": "(framework == \"net6\")"
},
"net7": {
"type": "computed",
"value": "(framework == \"net7\")"
},
"net8": {
"type": "computed",

Some files were not shown because too many files have changed in this diff Show More