Skip to content

Instantly share code, notes, and snippets.

@wayne-o
Created February 7, 2014 16:49
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 wayne-o/8866673 to your computer and use it in GitHub Desktop.
Save wayne-o/8866673 to your computer and use it in GitHub Desktop.
public class CacheItem : IHaveId, ICloneable
{
[PrimaryKey, AutoIncrement]
public int localid { get; set; }
public string id { get; set; }
public decimal? price { get; set; }
public string sku { get; set; }
public string imageurl { get; set; }
public string rating { get; set; }
public int DisplayIndex{get;set;}
public string name { get; set; }
public string image { get; set; }
public string Category{get;set;}
[Indexed]
public bool IsCategory{ get;set;}
[Indexed]
public bool IsProduct{ get;set;}
[Indexed]
public string Term{ get; set; }
public double Score { get; set; }
public override string ToString()
{
return string.Format("[CacheItem: localid={0}, id={1}, price={2}, sku={3}, imageurl={4}, rating={5}, DisplayIndex={6}, name={7}, image={8}, Category={9}, IsCategory={10}, IsProduct={11}, Term={12}, Score={13}]", localid, id, price, sku, imageurl, rating, DisplayIndex, name, image, Category, IsCategory, IsProduct, Term, Score);
}
#region ICloneable implementation
public object Clone()
{
return new CacheItem{
DisplayIndex = this.DisplayIndex,
name = this.name,
image = this.image,
localid = this.localid,
id = this.id,
price = this.price,
sku = this.sku,
imageurl = this.imageurl,
rating = this.rating,
Score = this.Score
};
}
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment