/// <summary> /// Updates the instance. /// </summary> /// <param name="objectUpdate">The object update.</param> /// <returns>IPureObject.</returns> /// <autogeneratedoc /> public virtual IPureObject UpdateInstance(IPureObject objectUpdate) { if (objectUpdate == null) { throw new ArgumentNullException(nameof(objectUpdate)); } if (ObjectId.Equals(objectUpdate.ObjectId)) { if (objectUpdate.ObjectVersion > ObjectVersion) { Logger?.LogTrace("IPureObject:UpdateInstance: "); ObjectVersion = objectUpdate.ObjectVersion; } IncrementObjectVersion(); ModifiedTimestamp = DateTimeOffset.Now; } else { Logger?.LogDebug("UpdateInstance called when {CurObjectId} != {UpdateObjectId}", ObjectId, objectUpdate.ObjectId); } return(this); }
/// <summary> /// Compares to. /// </summary> /// <param name="other">The other.</param> /// <returns>System.Int32.</returns> /// <exception cref="ArgumentException">Object must be of type DeviceBase.</exception> /// <autogeneratedoc /> public override int CompareTo(IPureObject other) { if (other == null) { return(1); } if (!(other is DeviceBase)) { throw new ArgumentException("Object must be of type DeviceBase."); } return(CompareTo((DeviceBase)other)); }
/// <summary> /// Compares to. /// </summary> /// <param name="other">The other.</param> /// <returns>System.Int32.</returns> /// <autogeneratedoc /> public override int CompareTo(IPureObject other) { return(CompareTo((PureObjectBaseTest)other)); }
/// <summary> /// Compares to. /// </summary> /// <param name="other">The other.</param> /// <returns>System.Int32.</returns> /// <autogeneratedoc /> public int CompareTo(IPureObject other) { return(Value.CompareTo(other)); }
/// <summary> /// Compares to. /// </summary> /// <param name="other">The other.</param> /// <returns>System.Int32.</returns> /// <autogeneratedoc /> public virtual int CompareTo(IPureObject other) { return(other == null ? 1 : ObjectId.CompareTo(other.ObjectId)); }
/// <summary> /// Determines whether [is same object version] [the specified object other]. /// </summary> /// <param name="objectOther">The object other.</param> /// <returns><c>true</c> if [is same object version] [the specified object other]; otherwise, <c>false</c>.</returns> /// <autogeneratedoc /> public bool IsSameObjectVersion(IPureObject objectOther) => objectOther != null && ObjectVersion == objectOther.ObjectVersion;
/// <summary> /// Determines whether [is same object identifier] [the specified object other]. /// </summary> /// <param name="objectOther">The object other.</param> /// <returns><c>true</c> if [is same object identifier] [the specified object other]; otherwise, <c>false</c>.</returns> /// <autogeneratedoc /> public bool IsSameObjectId(IPureObject objectOther) => objectOther != null && ObjectId.Equals(objectOther.ObjectId);