Exemple #1
0
        public BookData Copy()
        {
            var result = new BookData();

            result.ID = ID;
            result.ServicesLinks.AddRange(ServicesLinks.Select(link => link.Copy()));
            result.DataItemsLinks.AddRange(DataItemsLinks.Select(link => link.Copy()));

            return(result);
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            var other = obj as BookData;

            if (other == null)
            {
                return(false);
            }

            if (other.ID != ID)
            {
                return(false);
            }

            if (!(other.ServicesLinks == null && ServicesLinks == null ||
                  other.ServicesLinks != null && ServicesLinks != null && other.ServicesLinks.Count == ServicesLinks.Count && other.ServicesLinks.TrueForAll(link => ServicesLinks.Contains(link))))
            {
                return(false);
            }

            return(other.DataItemsLinks == null && DataItemsLinks == null ||
                   other.DataItemsLinks != null && DataItemsLinks != null && other.DataItemsLinks.Count == DataItemsLinks.Count && other.DataItemsLinks.TrueForAll(link => DataItemsLinks.Contains(link)));
        }