Skip to content

Instantly share code, notes, and snippets.

@Llano

Llano/main.cs Secret

Last active Jan 20, 2021
Embed
What would you like to do?
class Opel : Car {}
class Volvo : Car {}
class HandleVolvo
{
HandleVolvo(Volvo volvo)
{
}
}
class HandleSaab
{
HandleSaab(Saab saab)
{
}
}
static void Main(string[] args) {
...
var return = (Car)response;
//Call correct Handle-class based on Car
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment