I locate the
attributes are a little disorganized, so I'd like to accomplish this in code, maybe via a config function. Can this be done?
These qualities are not required at all.
will serialize all public properties with getter and setter, however if you serialize entities with navigation properties, "cyclic reference" will quickly lead to an exception.
You have two options to prevent that exception:
[DataContract(IsReference = true)]
using your entity class
if you want to serilize or
You don't want to serialize on all and all properties.
The last and most difficult alternative is to totally ignore characteristics and create them using custom classes.
to regulate outside-of-the-type serialization.
You may create an entirely unique serialization technique, employ binary or XML serialization with all of its requirements, or both.