public static bool TryCreate(IRowVersion rowVersion, out string eTag) { if (rowVersion == null) { throw new ArgumentNullException("rowVersion"); } eTag = null; if (rowVersion != null) { eTag = BitHelper.ConvertToHex(rowVersion.RowVersion); } return(eTag != null); }
public static bool TryCreate(IPreconditionInformation info, out string eTag) { if (info == null) { throw new ArgumentNullException("info"); } eTag = null; if (info.RowVersion != null && info.RowVersion.Length > 0) { eTag = BitHelper.ConvertToHex(info.RowVersion); } else { eTag = BitHelper.ConvertToHex(info.ModifiedOn); } return(eTag != null); }
public static bool TryCreate(IEnumerable <IModifiedTimestamp> modifiableItems, out string eTag) { if (modifiableItems == null) { throw new ArgumentNullException(nameof(modifiableItems)); } if (modifiableItems.Any()) { // In a collection, only the most recent modified date is interesting. eTag = BitHelper.ConvertToHex(modifiableItems.Max(i => i.ModifiedOn)); return(true); } else { eTag = null; return(false); } }
public static bool TryCreate(DateTimeOffset timestamp, out string eTag) { eTag = BitHelper.ConvertToHex(timestamp); return(true); }