public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this IOwnerAcknowledgement self, System.Func <OwnerAcknowledgementSent, System.Threading.Tasks.Task <R> > whenOwnerAcknowledgementSent, System.Func <OwnerAcknowledgementNotSent, System.Threading.Tasks.Task <R> > whenOwnerAcknowledgementNotSent) { switch ((self)) { case OwnerAcknowledgementSent owneracknowledgementsent: return(await whenOwnerAcknowledgementSent(owneracknowledgementsent)); case OwnerAcknowledgementNotSent owneracknowledgementnotsent: return(await whenOwnerAcknowledgementNotSent(owneracknowledgementnotsent)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }
public static R Match <R>(this IOwnerAcknowledgement self, System.Func <OwnerAcknowledgementSent, R> whenOwnerAcknowledgementSent, System.Func <OwnerAcknowledgementNotSent, R> whenOwnerAcknowledgementNotSent) { switch ((self)) { case OwnerAcknowledgementSent owneracknowledgementsent: return(whenOwnerAcknowledgementSent(owneracknowledgementsent)); case OwnerAcknowledgementNotSent owneracknowledgementnotsent: return(whenOwnerAcknowledgementNotSent(owneracknowledgementnotsent)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }