I would like to define a custom serialization method for types that implement an interface; however, JsConfig<ISomething>.RawSerialzieFn doesn't get picked up.

Other suggestions?

mythz
—
2017-08-11T16:41:57Z —
#2

No there's nothing by interface, that would be very expensive to check for every interface for every type.

You could do the inverse, have a method that scans all assemblies for types that implement an interface and use reflection to register the same RawSerializeFn handler for each type.

sirthomas
—
2017-08-11T16:56:06Z —
#3

That's what I was thinking, but the syntax is a little funky to set JsConfig func values dynamically. Poking around with that now, trying to get the correct way to create the function delegate with runtime type.