public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ICreateReplyResult self, System.Func <ReplyCreated, System.Threading.Tasks.Task <R> > whenReplyCreated, System.Func <InvalidIdRequest, System.Threading.Tasks.Task <R> > whenInvalidIdRequest) { switch ((self)) { case ReplyCreated replycreated: return(await whenReplyCreated(replycreated)); case InvalidIdRequest invalididrequest: return(await whenInvalidIdRequest(invalididrequest)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }
public static ICreateReplyResult Match(this ICreateReplyResult self, System.Func <ReplyCreated, ICreateReplyResult> whenReplyCreated, System.Func <InvalidIdRequest, ICreateReplyResult> whenInvalidIdRequest) { switch ((self)) { case ReplyCreated replycreated: return(whenReplyCreated(replycreated)); case InvalidIdRequest invalididrequest: return(whenInvalidIdRequest(invalididrequest)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }