using System;
using DatabaseEditor.BL.Attributes;

namespace DatabaseEditor.BL.Models
{
    public class BookListModel : ItemModelBase, IEquatable<BookListModel>
    {
        [SearchableProperty]
        public string ISBN { get; set; }

        [SearchableProperty]
        public string Name { get; set; }

        [SearchableProperty]
        public int Pages { get; set; }

        [SearchableProperty]
        public int Year { get; set; }

        public bool Equals(BookListModel other)
        {
            if (other == null) return false;
            if (this.Name == other.Name &&
                this.ISBN == other.ISBN &&
                this.Pages == other.Pages &&
                this.Year == other.Year &&
                this.Id == other.Id)
                return true;
            return false;
        }
    }
}
