public static async System.Threading.Tasks.Task <R> MatchAsync <R>(this IAuthorAcknowledgement self, System.Func <AuthorAcknowledgementSent, System.Threading.Tasks.Task <R> > whenAuthorAcknowledgementSent, System.Func <AuthorAcknowledgementNotSent, System.Threading.Tasks.Task <R> > whenAuthorAcknowledgementNotSent) { switch ((self)) { case AuthorAcknowledgementSent authoracknowledgementsent: return(await whenAuthorAcknowledgementSent(authoracknowledgementsent)); case AuthorAcknowledgementNotSent authoracknowledgementnotsent: return(await whenAuthorAcknowledgementNotSent(authoracknowledgementnotsent)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }
public static R Match <R>(this IAuthorAcknowledgement self, System.Func <AuthorAcknowledgementSent, R> whenAuthorAcknowledgementSent, System.Func <AuthorAcknowledgementNotSent, R> whenAuthorAcknowledgementNotSent) { switch ((self)) { case AuthorAcknowledgementSent authoracknowledgementsent: return(whenAuthorAcknowledgementSent(authoracknowledgementsent)); case AuthorAcknowledgementNotSent authoracknowledgementnotsent: return(whenAuthorAcknowledgementNotSent(authoracknowledgementnotsent)); default: throw new System.NotSupportedException("This switch statement should be exhaustive"); } }