ExtendedXmlSerializer / home

A configurable and eXtensible Xml serializer for .NET.

Home Page:https://extendedxmlserializer.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to Ignore Specific Types?

imperiobadgo opened this issue · comments

I have another question: How can I exclude certain class types from serialisation?
With the following you can ignore individual members of a class:
myConfiguration.Type<MyClassWithExcludingMember>().Member(x => x.MemberToIgnore).Ignore();

There is already the possibility to add the classes to IgnoredReferenceTypes(), but this is apparently not used.
I'm probably just missing something...

I'm probably just missing something...

You are indeed @imperiobadgo and it's the feature itself. 😆 Not sure how we didn't have something like that before. I threw together a copy/paste of the member variant, so please let me know if you encounter any issues using it:
#516 (comment)

FWIW any additional functionality around this area such as EmitWhen etc is a little more involved so we may have to rely on a community contribution if such functionality is needed.

It just works exactly the way I need it to! Your work is just phenomenal!!!
Thank you very much for your super fast and perfect processing of my questions.

This has been released on NuGet in v3.7.0:
https://www.nuget.org/packages/ExtendedXmlSerializer/

Please do let me know if you encounter any additional questions around this issue or any others and I will look into it for you. Thank you for improving ExtendedXmlSerializer! Closing for now.

An extensible Xml Serializer for .NET that builds on the functionality of the classic XmlSerializer with a powerful and robust extension model.