diff --git a/modelina-website/src/components/playground/options/CSharpGeneratorOptions.tsx b/modelina-website/src/components/playground/options/CSharpGeneratorOptions.tsx index 0619151b2a..de58096e89 100644 --- a/modelina-website/src/components/playground/options/CSharpGeneratorOptions.tsx +++ b/modelina-website/src/components/playground/options/CSharpGeneratorOptions.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { PlaygroundCSharpConfigContext } from '@/components/contexts/PlaygroundConfigContext'; import Select from '@/components/Select'; import { debounce } from 'lodash'; +import InfoModal from '@/components/InfoModal'; interface CSharpGeneratorOptionsProps { setNewConfig?: (queryKey: string, queryValue: string) => void; @@ -23,10 +24,13 @@ class CSharpGeneratorOptions extends React.Component< super(props); this.state = defaultState; this.onChangeArrayType = this.onChangeArrayType.bind(this); - this.onChangeAutoImplementProperties = this.onChangeAutoImplementProperties.bind(this); - this.onChangeOverwriteHashCodeSupport = this.onChangeOverwriteHashCodeSupport.bind(this); + this.onChangeAutoImplementProperties = + this.onChangeAutoImplementProperties.bind(this); + this.onChangeOverwriteHashCodeSupport = + this.onChangeOverwriteHashCodeSupport.bind(this); this.onChangeIncludeJson = this.onChangeIncludeJson.bind(this); - this.onChangeOverwriteEqualSupport = this.onChangeOverwriteEqualSupport.bind(this); + this.onChangeOverwriteEqualSupport = + this.onChangeOverwriteEqualSupport.bind(this); this.onChangeIncludeNewtonsoft = this.onChangeIncludeNewtonsoft.bind(this); this.onChangeNullable = this.onChangeNullable.bind(this); this.onChangeNamespace = this.onChangeNamespace.bind(this); @@ -62,7 +66,7 @@ class CSharpGeneratorOptions extends React.Component< this.props.setNewConfig('csharpOverwriteEqual', event.target.checked); } } - + onChangeIncludeNewtonsoft(event: any) { if (this.props.setNewConfig) { this.props.setNewConfig('csharpIncludeNewtonsoft', event.target.checked); @@ -80,7 +84,7 @@ class CSharpGeneratorOptions extends React.Component< } onChangeNamespace(event: any) { - this.setState({ ...this.state, namespace: event.target.value }) + this.setState({ ...this.state, namespace: event.target.value }); if (this.props.setNewConfig) { this.debouncedSetNewConfig('csharpNamespace', event.target.value); } @@ -94,8 +98,18 @@ class CSharpGeneratorOptions extends React.Component<

CSharp Specific options

-
  • -
  • + +

    + In C#, a namespace is used to organize code into logical groups + and avoid naming conflicts. It provides a way to uniquely identify + classes, structs, interfaces, and other types within a project. By + specifying a namespace for the generated C# data models, you can + control their visibility and easily reference them in other parts + of your code. +

    +
    +
  • -
  • -
  • + +

    + In C#, arrays are used to store collections of elements of the + same type. The C# array type option determines + how arrays are represented in the generated C# data models. If you + choose the + array type, the models will use the C# array + syntax, such as int[] or string[]. +
    +
    + Alternatively, if you choose the List type, the + models will use the List<T> class from the + System.Collections.Generic namespace, providing additional + functionality and flexibility for working with collections. +

    +
    +
  • -
  • -
  • + +

    + Auto-implemented properties in C# allow you to define properties + without explicitly writing the backing field. The compiler + automatically generates the backing field and the get/set methods + for you. When the{' '} + Include auto-implemented properties option is + enabled, the generated C# data models will use this simplified + syntax for property declarations, reducing the amount of + boilerplate code you need to write. +

    +
    +
  • -
  • -
  • + +

    + In C#, the GetHashCode() method is used to generate a hash code + for an object. This method is often overridden when you need to + define custom equality comparisons or store objects in hash-based + data structures. By enabling the{' '} + Include Overwrite HashCode Support option, the + generated C# data models will include support for overwriting the + GetHashCode() method, allowing you to customize the hash code + calculation based on the model's properties. +

    +
    +
  • -
  • -
  • + +

    + The Equals() method in C# is used to compare two objects for + equality. By default, it performs reference equality comparison. + However, in certain cases, you may want to override this method to + provide custom equality logic based on specific properties or + criteria. Enabling the{' '} + Include Overwrite Equal Support option in the + generated C# data models includes support for overwriting the + Equals() method, allowing you to define your own equality + comparisons. +

    +
    +
  • -
  • -
  • + +

    + In C#, JSON serialization is the process of converting an object + to its JSON representation and vice versa. Enabling the{' '} + Include JSON serialization option in the + generated C# data models includes the necessary attributes and + code to facilitate JSON serialization, making it easy to serialize + the models to JSON format or deserialize JSON data into instances + of the models. +

    +
    +
  • -
  • -
  • + +

    + Newtonsoft.Json (Json.NET) is a popular third-party JSON + serialization library for C#. It provides advanced features and + customization options for working with JSON data. When the + Include Newtonsoft serialization option is + enabled in the generated C# data models, the necessary attributes + and code are included to support serialization and deserialization + using the Json.NET library. +

    +
    +
  • -
  • -
  • + +

    + In C#, the nullable feature allows you to explicitly indicate + whether a value type (such as int, bool, etc.) or a reference type + (such as a class) can accept null values. By enabling the + Nullable option in the generated C# data models, + you allow properties to be nullable, meaning they can have a null + value in addition to their normal value range. This provides + flexibility when dealing with optional or unknown data values. +

    +
    +