Skip to content

Instantly share code, notes, and snippets.

@rje
Created December 1, 2015 18:43
Show Gist options
  • Save rje/aae9f179397449f3eed9 to your computer and use it in GitHub Desktop.
Save rje/aae9f179397449f3eed9 to your computer and use it in GitHub Desktop.
public abstract class A
{
public int Foo = 1;
}
public class B : A
{
public int Bar = 2;
}
public class C : A
{
public int Baz = 3;
}
public class ToSerialize {
public List<A> MyList;
public ToSerialize() {
MyList = new List<A>();
MyList.Add(new B());
MyList.Add(new C());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment