Skip to content

Instantly share code, notes, and snippets.

@marcduiker
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcduiker/95d14b8fb50300bb45b9 to your computer and use it in GitHub Desktop.
Save marcduiker/95d14b8fb50300bb45b9 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using System.Linq;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using SitecorePlayground.Common.Interfaces.Adapters;
namespace SitecorePlayground.Common.Adapters
{
public class ItemAdapter : IItemAdapter
{
public ItemAdapter(Item item)
{
Assert.ArgumentNotNull(item, "item");
this.InnerItem = item;
}
public string DisplayName
{
get { return InnerItem.DisplayName; }
}
public ID Id
{
get { return InnerItem.ID; }
}
public Item InnerItem
{
get;
private set;
}
public ID TemplateId
{
get { return InnerItem.TemplateID; }
}
public string this[string fieldName]
{
get { return InnerItem.Fields[fieldName].Value; }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment