public static TaggedUnion <TFirst, TSecond> OrInitialize <TFirst, TSecond>( this TaggedUnion <TFirst, TSecond> union, Func <TaggedUnion <TFirst, TSecond> > otherFactory) { _ = otherFactory ?? throw new ArgumentNullException(nameof(otherFactory)); return(union.InternalOrInitialize(Pipeline.Pipe, otherFactory)); }
public static ValueTask <TaggedUnion <TFirst, TSecond> > OrInitializeValueAsync <TFirst, TSecond>( this TaggedUnion <TFirst, TSecond> union, Func <ValueTask <TaggedUnion <TFirst, TSecond> > > otherFactoryAsync) { _ = otherFactoryAsync ?? throw new ArgumentNullException(nameof(otherFactoryAsync)); return(union.InternalOrInitialize(ValueTask.FromResult, otherFactoryAsync)); }