﻿namespace Parts.Models
{
    public class Category
    {
        public Category(string name, string path)
        {
            this.Name = name;
            this.Path = path;
        }

        public int Id { get; set; }

        public string Name { get; set; }

        public string Path { get; set; }

        public int ParentId { get; set; }

        public override bool Equals(object obj)
        {
            Category comparedObject = (obj as Category);
            return this.Name == comparedObject.Name && this.Path == comparedObject.Path;
        }

        public override int GetHashCode()
        {
            return this.Name.GetHashCode() + this.Path.GetHashCode();
        }
    }
}
