Contentstack Entry Model Base Class

The following base class for Entry Model classes can expose all the values that I could find that can appear in any Contentstack Entry that appeared as if they could be useful, even if Contentstack does not expose those values as Fields in the CMS UI (those values are more like…properties, which is basically the opposite of field and property definitions in .NET classes).

You can use something like this as a base class for your Entry Models. For memory and CPU considerations around serialization, Entry Model Classes in general should not expose properties that the code does not need (in which case, investigate techniques in the vendor’s SDK to specify or exclude specific Fields from the JSON representation of an Entry).

This definitely reflects a vendor-specific JSON format and values available from a specific vendor. As it is basically just a flat list of Field Values (except for publishing details) in standard formats with no dependence on the SDK, I can accept it. To switch CMS, at a minimum I would probably need to add some JsonProperty attributes to these properties.

See how this compares to the JSON:

One thought on “Contentstack Entry Model Base Class

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: