The constructors of a C# class are created using the “create” stereotype in Modelio.
Since the passing mode of the parameters in C# is through reference, all the parameters of an operation, except the return parameter, are of In/Out type.
When you import an attribute or a parameter with a primitive C# type, equivalence is established with Modelio’s predefined types. Certain C# types require the addition of a tagged value.
Primitive C# type | Type in the repository | Tagged value |
---|---|---|
bool | boolean | N/A |
char | char | N/A |
int | integer | N/A |
uint | integer | CsUnsignedInt |
short | short | N/A |
ushort | short | CsUnsignedShort |
long | long | N/A |
ulong | long | CsUnsignedLong |
sbyte | byte | CsSignedByte |
byte | byte | N/A |
float | float | N/A |
double | double | N/A |
decimal | double | CsDecimal |
When a type declaration cannot be expressed in Modelio, it is encapsulated in a {CsTypeExpr} tagged value, and the attribute, association or parameter type gets the “undefined” value.
This {CsTypeExpr} tagged value is not included in the signature of a method. Therefore, if an “m1” method is defined containing the only parameter which has a type that cannot be expressed (a CsTypeExpr), the creation of a second “m1” method with only one CsTypeExpr parameter will not be accepted by Modelio. This situation, however, is very rare.