Skip to content

10.1.1

Choose a tag to compare

@pokornyd pokornyd released this 23 Apr 09:09
· 3 commits to master since this release

Kontent.ai model generator for .NET 10.1.1

Fixes ContentTypeCodename on generated records to be a compile-time constant instead of an instance property.

For details on the 10.1.0 changes, see the 10.1.0 release notes.

Changes

  • ContentTypeCodename is now a public const string — previously emitted as an expression-bodied instance property (public string ContentTypeCodename => "article";), which required allocating an instance to read the value and could not be used in contexts that require a compile-time constant. It now emits public const string ContentTypeCodename = "article";, enabling use in switch/case labels (e.g., dispatching on item.System.Type), attribute arguments, and static lookup tables. Collision handling (renaming conflicting element members to _ContentTypeCodename) is unchanged.

Migration

  • Call sites that accessed ContentTypeCodename through an instance reference (e.g., article.ContentTypeCodename) will no longer compile. Access it through the type name instead (Article.ContentTypeCodename).

Full Changelog: 10.1.0...10.1.1