Created
November 22, 2014 20:35
-
-
Save marcduiker/523551a33b3c46904b43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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