I have a clean redistributable model that contains a lot of derived classes. Just to be clear, see the example below.
class Foo
{
...
}
class BarA:Foo
{
...
}
class BarB:Foo
{
...
}
In order to deserialize those classes from Json to the correct class (e.g. BarA, instead of just Foo), I created my own converters by inheriting JsonConverter. It works perfect for my application, but this requires that others using this library to write their own converters. I don't want to include the converters to my model, because that would create a dependency to JSON.NET and from there hell breaks loose when projects in the solution using it have different versions of JSON.NET.
Is there any clean way to do this, without polluting the pure .NET model?