public GetTagsFromObjectOp <TObject> DeepCloneWithObjectToDetermineTagsFrom(TObject objectToDetermineTagsFrom) { var result = new GetTagsFromObjectOp <TObject>( objectToDetermineTagsFrom); return(result); }
/// <inheritdoc /> public IReadOnlyDictionary <string, string> Execute( GetTagsFromObjectOp <TObject> operation) { if (operation.ObjectToDetermineTagsFrom is IHaveTags hasTagsObject) { return(hasTagsObject.Tags); } throw new ArgumentException(FormattableString.Invariant($"Cannot extract an Tags from type '{typeof(TObject).ToStringReadable()}' because it does not implement '{typeof(IHaveTags).ToStringReadable()}'.")); }
/// <inheritdoc /> public bool Equals(GetTagsFromObjectOp <TObject> other) { if (ReferenceEquals(this, other)) { return(true); } if (ReferenceEquals(other, null)) { return(false); } var result = this.ObjectToDetermineTagsFrom.IsEqualTo(other.ObjectToDetermineTagsFrom); return(result); }
/// <inheritdoc /> public async Task <IReadOnlyDictionary <string, string> > ExecuteAsync( GetTagsFromObjectOp <TObject> operation) { return(await Task.FromResult(this.Execute(operation))); }