public GetConstOp <TValue> DeepCloneWithValue(TValue value)
        {
            var result = new GetConstOp <TValue>(
                value);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Builds an operation that gets a specified const value.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="value">The value.</param>
        /// <returns>
        /// An operation that gets the specified value.
        /// </returns>
        public static GetConstOp <TValue> Const <TValue>(
            TValue value)
        {
            var result = new GetConstOp <TValue>(value);

            return(result);
        }
Beispiel #3
0
        /// <inheritdoc />
        public TValue Execute(
            GetConstOp <TValue> operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            var result = operation.Value;

            return(result);
        }
Beispiel #4
0
        /// <inheritdoc />
        public async Task <TValue> ExecuteAsync(
            GetConstOp <TValue> operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            var result = await Task.FromResult(operation.Value);

            return(result);
        }
        /// <inheritdoc />
        public bool Equals(GetConstOp <TValue> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            var result = this.Value.IsEqualTo(other.Value);

            return(result);
        }