Saturday, January 18, 2014

Error for enumerable when using JsonConvert.SerializeObject


[Serializable]
    public abstract class Entity
    {
        public Entity()
        {
        }

        public Entity(int id)
        {
            this.Id = id;
        }

        public virtual int Id { get; set; }

        public override bool Equals(object obj)
        {
            Entity other = (Entity)obj;
            return this.Id == other.Id;
        }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }
    }

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates