Created
July 30, 2015 07:52
-
-
Save Wesley-Lomax/4dcfe6b613fe6159a462 to your computer and use it in GitHub Desktop.
Sitecore Glass Mapper and Solr BaseSearchResultItem
This file contains 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 System; | |
using System.ComponentModel; | |
using Glass.Mapper.Sc.Configuration; | |
using Glass.Mapper.Sc.Configuration.Attributes; | |
using System.Xml.Serialization; | |
using Sitecore.ContentSearch; | |
using Sitecore.ContentSearch.Converters; | |
using Sitecore.Data; | |
using Sitecore.Data.Items; | |
namespace WesleyLomax.Common.Model.Base | |
{ | |
[Serializable] | |
public abstract class BaseSearchResultItem | |
{ | |
[SitecoreId] | |
[IndexField("_group")] | |
public virtual Guid Id { get; set; } | |
[SitecoreInfo(SitecoreInfoType.Language)] | |
[IndexField("_language")] | |
public virtual string Language { get; set; } | |
[TypeConverter(typeof(IndexFieldItemUriValueConverter))] | |
[XmlIgnore] | |
[IndexField("_uniqueid")] | |
public virtual ItemUri Uri { get; set; } | |
[SitecoreInfo(SitecoreInfoType.Version)] | |
public virtual int Version | |
{ | |
get | |
{ | |
return Uri == null ? 0 : Uri.Version.Number; | |
} | |
} | |
[IndexField("_name")] | |
public virtual string Name { get; set; } | |
[IndexField("_template")] | |
[TypeConverter(typeof(IndexFieldIDValueConverter))] | |
public virtual ID TemplateId { get; set; } | |
[IndexField("_uniqueid")] | |
public virtual string UniqueId { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment