/// <summary> /// Wraps the specified inner policy. /// </summary> /// <param name="innerPolicy">The inner policy.</param> /// <typeparam name="TResult">The return type of delegates which may be executed through the policy.</typeparam> /// <returns>PolicyWrap.PolicyWrap.</returns> public PolicyWrap <TResult> Wrap <TResult>(Policy <TResult> innerPolicy) { if (innerPolicy == null) { throw new ArgumentNullException(nameof(innerPolicy)); } return(new PolicyWrap <TResult>( (func, context, cancellationtoken) => PolicyWrapEngine.Implementation <TResult>(func, context, cancellationtoken, this, innerPolicy) )); }
/// <summary> /// Wraps the specified inner policy. /// </summary> /// <param name="innerPolicy">The inner policy.</param> /// <returns>PolicyWrap.PolicyWrap.</returns> public PolicyWrap Wrap(Policy innerPolicy) { if (innerPolicy == null) { throw new ArgumentNullException(nameof(innerPolicy)); } return(new PolicyWrap( (action, context, cancellationtoken) => PolicyWrapEngine.Implementation(action, context, cancellationtoken, this, innerPolicy) )); }