Skip to content

Instantly share code, notes, and snippets.

@marcduiker
Created November 22, 2014 20:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save marcduiker/523551a33b3c46904b43 to your computer and use it in GitHub Desktop.
using Sitecore.Data;
using Sitecore.Data.Items;
using SitecorePlayground.Common.Adapters;
using SitecorePlayground.Common.Interfaces.Adapters;
using SitecorePlayground.Common.Interfaces.Providers;
namespace SitecorePlayground.Common.Providers
{
public class ItemProvider : IItemProvider
{
public Item GetItem(ID itemId)
{
return Sitecore.Context.Database.GetItem(itemId);
}
public IItemAdapter GetItemAdapter(ID itemId)
{
var item = GetItem(itemId);
return item != null ? new ItemAdapter(item) : null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment