This sample generates a basic C# source file for each Class of a UML input model. The sample generates:
|
Here is an example of a UML 1.3 based C# generation launch:

| Feature | Example | Location | Reference |
| Calling a text template from a rule | $CsharpSource(class) |
CsharpGeneration.mqr |
template call |
| Including a text template from another text template | [#include Csharpdoc(class)] |
CsharpSource.tgt |
include |
| Trimming to avoid blank lines | ${attribute.accessors}[#trim] |
uml13_Class.tgs |
trim |
| Filtering a list of instances based on a criterium | self.parameter.reject("kind", RETURN_LITERAL) |
uml13_Operation.mqs |
MDWList |
| Specifying a default value | self.returnType.csharpType ? "void" |
uml13_Operation.mqs |
default value |
| Using protected sections to keep user code | [#protectedStartTag] |
uml13_Operation.mqs |
protected tags |