BotSharp/src/Infrastructure/BotSharp.Abstraction/Options/BotSharpOptions.cs

42 lines
913 B
C#
Raw Normal View History

2024-03-18 19:36:41 +00:00
using System.Text.Json;
namespace BotSharp.Abstraction.Options;
public class BotSharpOptions
{
private readonly static JsonSerializerOptions defaultJsonOptions = new JsonSerializerOptions()
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
AllowTrailingCommas = true,
2024-03-18 19:52:38 +00:00
WriteIndented = true
2024-03-18 19:36:41 +00:00
};
private JsonSerializerOptions _jsonSerializerOptions;
public JsonSerializerOptions JsonSerializerOptions
{
get
{
return _jsonSerializerOptions ?? defaultJsonOptions;
}
set
{
if (value == null)
{
_jsonSerializerOptions = defaultJsonOptions;
}
else
{
_jsonSerializerOptions = value;
}
}
}
public BotSharpOptions()
{
}
}