Life Through a Lens – Using the Sitecore ContentDatabase in Glass Mapper

This post should hopefully be a short one. Just to note that in the since v4.0.3 of Glass Mapper we have added a SitecoreContentContext. This class inherits from ISitecoreContext just as the regular SitecoreContext does.

This differs from the standard SitecoreContext in that it uses Sitecore.Context.ContentDatabase instead of Sitecore.Context.Database.


ISitecoreContext sitecoreContext = new SitecoreContentContext();

Happy Mapping!!

Advertisements

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