BotSharp/src/Infrastructure/BotSharp.Abstraction/Options/BotSharpOptions.cs
2024-04-01 22:33:42 -05:00

42 lines
913 B
C#

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,
WriteIndented = true
};
private JsonSerializerOptions _jsonSerializerOptions;
public JsonSerializerOptions JsonSerializerOptions
{
get
{
return _jsonSerializerOptions ?? defaultJsonOptions;
}
set
{
if (value == null)
{
_jsonSerializerOptions = defaultJsonOptions;
}
else
{
_jsonSerializerOptions = value;
}
}
}
public BotSharpOptions()
{
}
}