Example #1
0
        public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ISendQuestionOwnerAcknowledgementResult self, System.Func <AcknowledgementSent, System.Threading.Tasks.Task <R> > whenAcknowledgementSent, System.Func <AcknowledgementNotSent, System.Threading.Tasks.Task <R> > whenAcknowledgementNotSent)
        {
            switch ((self))
            {
            case AcknowledgementSent acknowledgementsent:
                return(await whenAcknowledgementSent(acknowledgementsent));

            case AcknowledgementNotSent acknowledgementnotsent:
                return(await whenAcknowledgementNotSent(acknowledgementnotsent));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }
Example #2
0
        public static R Match <R>(this ISendQuestionOwnerAcknowledgementResult self, System.Func <AcknowledgementSent, R> whenAcknowledgementSent, System.Func <AcknowledgementNotSent, R> whenAcknowledgementNotSent)
        {
            switch ((self))
            {
            case AcknowledgementSent acknowledgementsent:
                return(whenAcknowledgementSent(acknowledgementsent));

            case AcknowledgementNotSent acknowledgementnotsent:
                return(whenAcknowledgementNotSent(acknowledgementnotsent));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }