Skip to content

Instantly share code, notes, and snippets.

@serbrech
Created September 19, 2016 13:49
Show Gist options
  • Save serbrech/b0c50e96573ebde510b573dd15b52983 to your computer and use it in GitHub Desktop.
Save serbrech/b0c50e96573ebde510b573dd15b52983 to your computer and use it in GitHub Desktop.
foreach (var @event in events)
{
try
{
ApplyDynamic(@event);
}
catch (RuntimeBinderException runtimeBinder)
{
//if someone finds the way to extract the type out of that
throw new NotSupportedException($"The event type {@event.GetType().Name} is not supported by the model", runtimeBinder);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment