public static async Task <T> Match <T>(this IsmParameter parameter, Func <smParameters.atob, Task <T> > atob) { switch (parameter.Trigger.UnionCase) { case smTrigger.UnionCases.atob: return(await atob((smParameters.atob) parameter).ConfigureAwait(false)); default: throw new ArgumentException($"Unknown type derived from IsmParameter: {parameter.GetType().Name}"); } }
public static T Match <T>(this IsmParameter parameter, Func <smParameters.atob, T> atob) { switch (parameter.Trigger.UnionCase) { case smTrigger.UnionCases.atob: return(atob((smParameters.atob)parameter)); default: throw new ArgumentException($"Unknown type derived from IsmParameter: {parameter.GetType().Name}"); } }