XFEExtension
【DLL】XFE各类拓展是一个C#的DLL库,旨在优化C#代码中常用语句的使用,并提供更简洁的访问方式,同时提供Xunit测试框架,快速搭建服务器/客户端,免费ChatGPTAPI接口,免费通讯服务器,XFE下载器,新增格式等
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore/XFEExtension.NetCore.csproj
+1
-1
Modified
XFEExtension.NetCore/XFETransform/StringConverter/JsonTransformer.cs
+6
-2
XFEstudio/XFEExtension
修复部分Json转换器问题
227c07e
代码差异
2 个文件
+7
-3
@@ -5,7 +5,7 @@
5
5
<ImplicitUsings>enable</ImplicitUsings>
6
6
<Nullable>enable</Nullable>
7
7
<GenerateDocumentationFile>True</GenerateDocumentationFile>
8
<Version>3.3.7</Version>
8
<Version>3.3.8</Version>
9
9
<Title>XFEExtension</Title>
10
10
<RepositoryUrl>https://github.com/XFEstudio/XFEExtension</RepositoryUrl>
11
11
<AnalysisLevel>latest</AnalysisLevel>
@@ -28,8 +28,10 @@ public class JsonTransformer : StringConverter
28
28
outPutString += $"{(int)objectInfo.Value}";
29
29
else if (objectInfo.Value is bool)
30
30
outPutString += $"{objectInfo.Value.ToString()?.ToLower()}";
31
else
31
else if (objectInfo.Type == typeof(int) || objectInfo.Type == typeof(double) || objectInfo.Type == typeof(float) || objectInfo.Type == typeof(decimal) || objectInfo.Type == typeof(long) || objectInfo.Type == typeof(short) || objectInfo.Type == typeof(byte) || objectInfo.Type == typeof(nint) || objectInfo.Type == typeof(uint) || objectInfo.Type == typeof(ulong) || objectInfo.Type == typeof(ushort) || objectInfo.Type == typeof(sbyte))
32
32
outPutString += objectInfo.Value;
33
else
34
outPutString += $"\"{objectInfo.Value}\"";
33
35
}
34
36
else
35
37
{
@@ -41,8 +43,10 @@ public class JsonTransformer : StringConverter
41
43
outPutString += $"\"{objectInfo.Name}\":{(int)objectInfo.Value}";
42
44
else if (objectInfo.Value is bool)
43
45
outPutString += $"\"{objectInfo.Name}\":{objectInfo.Value.ToString()?.ToLower()}";
44
else
46
else if (objectInfo.Type == typeof(int) || objectInfo.Type == typeof(double) || objectInfo.Type == typeof(float) || objectInfo.Type == typeof(decimal) || objectInfo.Type == typeof(long) || objectInfo.Type == typeof(short) || objectInfo.Type == typeof(byte) || objectInfo.Type == typeof(nint) || objectInfo.Type == typeof(uint) || objectInfo.Type == typeof(ulong) || objectInfo.Type == typeof(ushort) || objectInfo.Type == typeof(sbyte))
45
47
outPutString += $"\"{objectInfo.Name}\":{objectInfo.Value}";
48
else
49
outPutString += $"\"{objectInfo.Name}\":\"{objectInfo.Value}\"";
46
50
}
47
51
}
48
52
else