@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Infrastructure.NewtonsoftJson
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class LowerCamelCaseJsonAttribute : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Infrastructure.NewtonsoftJson
|
||||
{
|
||||
public class LowerCamelCaseNamingStrategy : NamingStrategy
|
||||
{
|
||||
protected override string ResolvePropertyName(string name)
|
||||
{
|
||||
// 将属性名的首字母转换为小写
|
||||
return char.ToLower(name[0]) + name.Substring(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user