private static object GetFieldValue(Content item, string fieldAlias, string valueAlias, bool recursive)
{
switch (fieldAlias)
{
case "@id":
return item.Id;
case "@parentId":
return item.ParentContent().Id;
case "@name":
case "Name":
return item.Name;
case "@urlName":
case "UrlName":
return item.UrlName;
case "@path":
return item.GetPath().ToString();
case "@level":
return item.GetPath().Level;
case "@template":
return item.CurrentTemplate.Alias;
case "@templateId":
case "CurrentTemplateId":
return item.CurrentTemplate.Id;
case "@templateFileName":
return item.CurrentTemplate.Id.Value;
case "@nodeTypeAlias":
return item.ContentType.Alias;
case "@createDate":
return item.UtcCreated;
case "@updateDate":
return item.UtcModified;
case "@statusChangedDate":
return item.UtcStatusChanged;
default:
return item.Field(fieldAlias, valueAlias, recursive);
}
}
}