C# Generation#
The publish-cs command generates a C# class library from a COGS model.
Mapping#
Item types become generated C# classes that participate in the root
ItemContainer.Root item types implement identifiable behavior using the configured identification properties.
Composite types become reusable classes used as property types.
Primitive COGS types map to built-in .NET types or generated helper types.
JSON behavior#
The generated C# JSON contract matches the current JSON schema contract:
serialized data uses a flat
ItemContaineritemscontains all serialized itemstopLevelReferencescontains item referencesreferences are simple objects containing
$typeplus identification valuesreusable substitute datatypes are deserialized through
SubstitutionConverterusing$type
Generated project files#
When --csproj is used, the publisher also writes:
a generated
.csproja sibling
Directory.Packages.props
That makes the generated project self-contained outside the original repository tree.