Beispiel #1
0
        public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this ISendAckToQuestionOwnerResult self, System.Func <AckSent, System.Threading.Tasks.Task <R> > whenAckSent, System.Func <AckNotSent, System.Threading.Tasks.Task <R> > whenAckNotSent)
        {
            switch ((self))
            {
            case AckSent acksent:
                return(await whenAckSent(acksent));

            case AckNotSent acknotsent:
                return(await whenAckNotSent(acknotsent));

            default:
                throw new System.NotSupportedException("This switch statement should be exhaustive");
            }
        }
Beispiel #2
0
        public static R Match <R>(this ISendAckToQuestionOwnerResult self, System.Func <AckSent, R> whenAckSent, System.Func <AckNotSent, R> whenAckNotSent)
        {
            switch ((self))
            {
            case AckSent acksent:
                return(whenAckSent(acksent));

            case AckNotSent acknotsent:
                return(whenAckNotSent(acknotsent));

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