public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } Product var = obj as Product; if (GetType() != var.GetType()) { return(false); } if (GetHashCode() != var.GetHashCode()) { return(false); } if (this == var) { return(true); } return(Id == var.Id && Name == var.Name && Description == var.Description && Price == var.Price && // Picture == var.Picture && CategoryId == var.CategoryId && Stock == var.Stock); }