public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ICreateQuestionResult self, System.Func <QuestionPosted, System.Threading.Tasks.Task <R> > whenQuestionPosted, System.Func <QuestionNotPosted, System.Threading.Tasks.Task <R> > whenQuestionNotPosted, System.Func <QuestionValidationFailed, System.Threading.Tasks.Task <R> > whenQuestionValidationFailed) { switch ((self)) { case QuestionPosted questionposted: return(await whenQuestionPosted(questionposted)); case QuestionNotPosted questionnotposted: return(await whenQuestionNotPosted(questionnotposted)); case QuestionValidationFailed questionvalidationfailed: return(await whenQuestionValidationFailed(questionvalidationfailed)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }
public static ICreateQuestionResult Match(this ICreateQuestionResult self, System.Func <QuestionPosted, ICreateQuestionResult> whenQuestionPosted, System.Func <QuestionNotPosted, ICreateQuestionResult> whenQuestionNotPosted, System.Func <QuestionValidationFailed, ICreateQuestionResult> whenQuestionValidationFailed) { switch ((self)) { case QuestionPosted questionposted: return(whenQuestionPosted(questionposted)); case QuestionNotPosted questionnotposted: return(whenQuestionNotPosted(questionnotposted)); case QuestionValidationFailed questionvalidationfailed: return(whenQuestionValidationFailed(questionvalidationfailed)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }
public static R Match <R>(this ICreateQuestionResult self, System.Func <QuestionCreated, R> whenQuestionCreated, System.Func <QuestionNotCreated, R> whenQuestionNotCreated, System.Func <QuestionPublished, R> whenQuestionPublished, System.Func <QuestionNotPublished, R> whenQuestionNotPublished) { switch ((self)) { case QuestionCreated questioncreated: return(whenQuestionCreated(questioncreated)); case QuestionNotCreated questionnotcreated: return(whenQuestionNotCreated(questionnotcreated)); case QuestionPublished questionpublished: return(whenQuestionPublished(questionpublished)); case QuestionNotPublished questionnotpublished: return(whenQuestionNotPublished(questionnotpublished)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }
public static async System.Threading.Tasks.Task <ICreateQuestionResult> MatchAsync(this ICreateQuestionResult self, System.Func <QuestionCreated, System.Threading.Tasks.Task <ICreateQuestionResult> > whenQuestionCreated, System.Func <QuestionNotCreated, System.Threading.Tasks.Task <ICreateQuestionResult> > whenQuestionNotCreated, System.Func <QuestionPublished, System.Threading.Tasks.Task <ICreateQuestionResult> > whenQuestionPublished, System.Func <QuestionNotPublished, System.Threading.Tasks.Task <ICreateQuestionResult> > whenQuestionNotPublished) { switch ((self)) { case QuestionCreated questioncreated: return(await whenQuestionCreated(questioncreated)); case QuestionNotCreated questionnotcreated: return(await whenQuestionNotCreated(questionnotcreated)); case QuestionPublished questionpublished: return(await whenQuestionPublished(questionpublished)); case QuestionNotPublished questionnotpublished: return(await whenQuestionNotPublished(questionnotpublished)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }