public static Resolvable <T> When <T, TR>(this IEnvironmentBuilder bundle, TR match, Func <T> segment)
        {
            var wrapper = bundle.Bundle();

            return(new Resolvable <T>(() =>
            {
                var resolvedValue = wrapper.Build <TR>();
                if ((resolvedValue != null && resolvedValue.Equals(match)) ||
                    (match != null && match.Equals(resolvedValue)))
                {
                    return segment == null
                        ? default
                        : segment.Invoke();
                }

                return default;
            })
            {
                Scope = new FlowScope
                {
                    PreviousState = wrapper
                }
            });
Exemplo n.º 2
0
 public IEnvironmentBundle Bundle()
 {
     return(_builder.Bundle());
 }
 public static Resolvable <T> As <T>(this IEnvironmentBuilder bundle)
 {
     return(new Resolvable <T>(bundle.Bundle().Build <T>));
 }