How can I add a type constraint to include anything serializable in a generic method?
You can’t do this totally via generic constraints, but you can do a couple things to help: 1) Put the new() constraint on the generic type (to enable the ability to deserialize and to ensure the XmlSerializer doesn’t complain about a lack of default ctor): where T : new() 2) On the first line of … Read more