Remotely/Server/Services/PascalCasePolicy.cs
2021-07-29 07:56:44 -07:00

21 lines
457 B
C#

using System.Linq;
using System.Text.Json;
namespace Remotely.Server.Services
{
public class PascalCasePolicy : JsonNamingPolicy
{
public override string ConvertName(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
return name;
}
var first = name.First().ToString().ToUpper();
return first + new string(name.Skip(1).ToArray());
}
}
}