Skip to content

CSharpGeneratorSettings

Rico Suter edited this page Oct 4, 2017 · 16 revisions

Inherits from CodeGeneratorSettingsBase

Properties:

  • Namespace: The namespace of the generated classes
  • RequiredPropertiesMustBeDefined (default: true)
  • DateTimeType (default: DateTime)
  • ArrayType (default: ObservableCollection)
  • DictionaryType (default: Dictionary)
  • ClassStyle: Inpc (default) | Poco
  • JsonSerializerSettingsTransformationMethod: (default: null) A method to transform the serializer settings.

For example, you can implement the following class and set JsonSerializerSettingsTransformationMethod to MyNamespace .SerializerSettings.TransformSettings:

namespace MyNamespace
{
    internal static class SerializerSettings
    {
        public static JsonSerializerSettings TransformSettings(JsonSerializerSettings settings)
        {
            settings.DateParseHandling = DateParseHandling.DateTimeOffset;
            return settings;
        }
    }
}
Clone this wiki locally