I am trying to \"cherry-pick\" which objects in a collection of a specific type I want to serialize.
Example setup:
public class Person
{
public
You should not put the logic into serializer. Instead filter the collection and then serialize it. In this case, you may use something like this
Person.Courses = Person.Courses.Where(t=> t.ShouldSerialize == false);
return Person;
If you really need to add the contract resolver into your serializer you may do it in your Global.asax.cs (assuming you are using asp.net)