Closed MrNavaStar closed 8 months ago
Do you mean an attribute that includes/excludes a property of field from serializalization?
Correct
It doesn't. It's a contract-less serializer. If you want to exclude properties or fields would would need to implement a DTO.
Ah I see. I think Adding support for this annotation would make using this library a lot more straightforward forward (Especially for implementing into existing projects)
Will consider it for future release. In the meantime, you can create an object (DTO) that has the properties you want to serialize and use a library like AutoMapper to copy the fields/properties you wish to serialize
Support has been added for ignoring fields or properties in version 1.5 as follows:
[IgnoreDataMember]
public int MyProperty { get; set; }
I'm having trouble figuring out if this library respects the built in [NonSerialized] Annotation. If it doesn't, support for this would be awesome! If it does, I will be on my way, but maybe add something to the docs :)
Cheers!