public object ResolveItemFieldValue(object rawValue)
{
Link link = rawValue as Link;
if (link == null) return String.Empty;
if (link.LinkType == LinkTypes.Internal)
{
var item = Context.Database.GetItem(new ID(link.Id));
string fieldValue =
String.Format(
"<link linktype=\"internal\" url=\"/{0}\" querystring=\"\" id=\"{1}\" target=\"\" />",
item.Paths.ContentPath, link.Id.ToString("B").ToUpper());
return fieldValue;
}
else
{
throw new NotImplementedException("Cannot convert link type to sitecore xml field. YET");
}
}