/// <summary> /// Allows content to be read as parameters for a constructor call to activate an object, rather than the more /// traditional route of activating an object and its content read as property assignments. This is preferred -- /// required, even -- if your model is comprised of immutable objects. /// /// Note that there are several requirements for a class to be successfully processed: /// /// 1. only public fields / properties are considered /// 1. any public fields (spit) must be readonly /// 1. any public properties must have a get but not a set (on the public API, at least) /// 1. there must be exactly one interesting constructor, with parameters that are a case-insensitive match for /// each field/property in some order (i.e. there must be an obvious 1:1 mapping between members and constructor /// parameter names) /// </summary> /// <param name="this">The container to configure.</param> /// <returns>The configured container.</returns> /// <seealso href="https://github.com/ExtendedXmlSerializer/home/wiki/Features#immutable-classes-and-content"/> public static IConfigurationContainer EnableParameterizedContent(this IConfigurationContainer @this) => @this.Extend(ParameterizedMembersExtension.Default);
public static IConfigurationContainer EnableAttachedProperties(this IConfigurationContainer @this, ICollection <IProperty> properties, ICollection <Type> types) => @this.Extend(new AttachedPropertiesExtension(new Registrations <IProperty>(properties, types)));