"C#" language specificities

Telosys version : 4.0.0



To define C# as the target language call  #set( $env.language = 'C#' )  in the templates files.

The information below shows the behavior of the generator when 'C#' is the current target language.



Type conversion ( model type to language type )

The language type conversion has an impact on :
Model type     Default        @UnsignedType @NotNull       @PrimitiveType @ObjectType   
string string string string string String
byte sbyte byte sbyte sbyte SByte
short short ushort short short Int16
int int uint int int Int32
long long ulong long long Int64
decimal decimal decimal decimal decimal Decimal
float float float float float Single
double double double double double Double
boolean bool bool bool bool Boolean
date DateTime DateTime DateTime DateTime DateTime
time DateTime DateTime DateTime DateTime DateTime
timestamp DateTime DateTime DateTime DateTime DateTime
binary byte[] byte[] byte[] byte[] byte[]

Remarks

'@UnsignedType' has effect only for byte, short, int, long
'@ObjectType' switches to .Net types ( System.Int64, System.Boolean, etc)

'@NotNull' has no effect
'@PrimitiveType' has no effect



Literals for TRUE, FALSE and NULL

TRUE true
FALSE false
NULL null


Literal values

Model type Language type Language full type Language literal value example
string string string "AAA"
string String System.String "AAA"
byte sbyte sbyte 1
byte byte byte 1
byte SByte System.SByte 1
short short short 1
short ushort ushort 1
short Int16 System.Int16 1
int int int 100
int uint uint 100
int Int32 System.Int32 100
long long long 1000L
long ulong ulong 1000L
long Int64 System.Int64 1000L
decimal decimal decimal 10000.77M
decimal Decimal System.Decimal 10000.77M
float float float 1000.5F
float Single System.Single 1000.5F
double double double 1000.66D
double Double System.Double 1000.66D
boolean bool bool true
boolean Boolean System.Boolean true
date DateTime System.DateTime null
time DateTime System.DateTime null
timestamp DateTime System.DateTime null
binary byte[] byte[] null