-
-
Notifications
You must be signed in to change notification settings - Fork 535
CSharpGeneratorSettings
Rico Suter edited this page Jun 11, 2019
·
16 revisions
- Package: NJsonSchema.CodeGeneration
- Settings for: CSharpGenerator
- Class: CSharpGeneratorSettings.cs
Inherits from CodeGeneratorSettingsBase
Properties:
- Namespace: The namespace of the generated classes
- ClassStyle: Inpc (default) | Poco
- RequiredPropertiesMustBeDefined (default: true)
- GenerateDataAnnotations (default: true)
- DateType (default: DateTime)
- DateTimeType (default: DateTime)
- TimeType (default: TimeSpan)
- TimeSpanType (default: TimeSpan)
- ArrayType (default: Collection)
- DictionaryType (default: Dictionary)
- GenerateImmutableArrayProperties
- GenerateImmutableDictionaryProperties
- HandleReferences: (default: false)
- JsonConverters: Additional converter classes to apply to the serializer
- JsonSerializerSettingsTransformationMethod: (default: null) A method to transform the serializer settings.
JsonSerializerSettingsTransformationMethod
For example, you can implement the following class and set the method to MyNamespace.SerializerSettings.TransformSettings
:
namespace MyNamespace
{
internal static class SerializerSettings
{
public static JsonSerializerSettings TransformSettings(
JsonSerializerSettings settings)
{
settings.DateParseHandling = DateParseHandling.DateTimeOffset;
return settings;
}
}
}