Sitecore Hackathon 2015 Part II – EntityService in Sitecore.Services.Client

Continued from Part I outlining how Entity Service can be consumed by SPEAK.

EntityService in Sitecore.Services.Client

We opted for EntityService as opposed to ItemService as it allowed us to serve up custom, lean Models of Items and Fields. Containing only properties required for the Module providing we implement EntityIdenitity in the class definition.

One issue we did lose development time over was defining the itemId property. Without it being defined and exact casing it breaks the integration between SCC and the PageCode. Naming as such did piss off Resharper.

To ensure the developer is presented with enough information I implemented the Field’s Template Name and Id, for quick navigation, the fields current Value and it’s Standard Value. To ensure the fields were ordered to match that in the Content Editor, the Model holds the properties SectionSortOrder and SortOrder. Finally, exposing a property defining if the Field is a Standard Field means these fields can be hidden from view if so desired.

One of the good things of SSC is that the Controller can be kept lean by implementing a repository pattern based on Sitecore’s IRepository interface. Thus keeping the useful Create, Read, Update, Delete functions in a highly accessible area of the Solution Architecture.

Even if not all functions of the IRepository are required, they must be implemented.

For an intro to EntityService and Sitecore.Services.Client Mike has written a great post about it

< Part I – Introduction and Sitecore SPEAK

Part III – Dynamically Setting with Standard Values and Conclusion >

Advertisements

2 thoughts on “Sitecore Hackathon 2015 Part II – EntityService in Sitecore.Services.Client

  1. Pingback: Sitecore Hackathon 2015 Part I – Introduction and Sitecore SPEAK | Exercising Sitecore

  2. Pingback: Sitecore Hackathon 2015 Part III – Dynamically Setting with Standard Values and Conclusion | Exercising Sitecore

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s