AqlaSolutions / AqlaSerializer

Binary serializer with full .NET support!
http://www.aqla.net
Other
16 stars 3 forks source link

How to unregister or re-register a type? #51

Closed inethui closed 2 years ago

inethui commented 2 years ago

In unit tests, each test may want to setup their own types. The default model contains configuration for all types, which doesn't fit into the case of unit tests. Is there a way to erase everything registered, or override the existing registration with a different configuration?

AqlaSolutions commented 2 years ago

Create a separate model: TypeModel.Create

inethui commented 2 years ago

Thanks for the quick reply. If I create a new type model, does that mean I could not call the methods of "Serializer" anymore, instead, I should call the methods on the model? Is it possible to replace the default type model?

AqlaSolutions commented 2 years ago

Yes

inethui commented 2 years ago

Is it possible to replace the default runtime type model (RuntimeTypeModel.Default)?

AqlaSolutions commented 2 years ago

No. Make your own singleton and replace model there.

inethui commented 2 years ago

I see. Thanks!