Contentstack .NET Sample Entry Model

What follows is my attempt to define an Entry Model class as described in the blog post to support the Content Type that I described in the blog post at for the Contentstack SaaS headless CMS.

Somehow I managed to name three fields incorrectly. I already published entries and pastebinned the JSON so I chose to attribute the model properties rather than changing the Field definitions. I don’t like using the vendor’s Asset class in my Entry Models so I replaced it with a custom class that exposes the URL of the Asset.

Here is the output.

Potentially excluding access to Assets and Entries referenced by Entries of this Content Type, this Entry Model class could work with CMS from other vendors that support multiple values in individual Fields.

Actually, this example is too trivial because it does not describe how to handle Contentstack Modular Blocks ( I haven’t seen anything comparable to Modular Blocks in other CMS products, so modeling and implementing Modular Blocks will result in Entry Model classes that are specific to Contentstack data structures. As long as the Entry Models do not use the Contentstack .NET SDK directly, this is appropriate and really the only option other than parsing JSON by hand.

2 thoughts on “Contentstack .NET Sample Entry Model

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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: