示例#1
0
        public GetTagsFromObjectOp <TObject> DeepCloneWithObjectToDetermineTagsFrom(TObject objectToDetermineTagsFrom)
        {
            var result = new GetTagsFromObjectOp <TObject>(
                objectToDetermineTagsFrom);

            return(result);
        }
示例#2
0
        /// <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()}'."));
        }
示例#3
0
        /// <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);
        }
示例#4
0
 /// <inheritdoc />
 public async Task <IReadOnlyDictionary <string, string> > ExecuteAsync(
     GetTagsFromObjectOp <TObject> operation)
 {
     return(await Task.FromResult(this.Execute(operation)));
 }