public override int GetHashCode() { unchecked { var hashCode = (Authors1 != null? Authors1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Title != null? Title.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Authors2 != null? Authors2.GetHashCode() : 0); hashCode = (hashCode * 397) ^ HasOtherAuthors.GetHashCode(); hashCode = (hashCode * 397) ^ (Editor != null? Editor.GetHashCode() : 0); hashCode = (hashCode * 397) ^ HasOtherEditors.GetHashCode(); hashCode = (hashCode * 397) ^ Edition.GetHashCode(); hashCode = (hashCode * 397) ^ (PublisherCity != null? PublisherCity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PublisherName != null? PublisherName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PublisherYear.GetHashCode(); hashCode = (hashCode * 397) ^ Pages.GetHashCode(); hashCode = (hashCode * 397) ^ PageStart.GetHashCode(); hashCode = (hashCode * 397) ^ PageEnd.GetHashCode(); hashCode = (hashCode * 397) ^ Number.GetHashCode(); return(hashCode); } }
public void Save() { bool needSave = false; if (SortMainId > 0) { var o = SortMainObject.GetSortMain(SortMainId); if (o != null) { if (PublisherName?.Trim() != o.PublisherName) { o.PublisherName = PublisherName?.Trim(); needSave = true; } if (PublisherCity?.Trim() != o.PublisherCity) { o.PublisherCity = PublisherCity?.Trim(); needSave = true; } if (PublisherState?.Trim() != o.PublisherState) { o.PublisherState = PublisherState?.Trim(); needSave = true; } if (PublisherCountry != o.PublisherCountry) { o.PublisherCountry = PublisherCountry; needSave = true; } if (needSave) { o.Save(); } } } }