From 251102e1c52a8e0cc3a7009ded2262e6f9dd271f Mon Sep 17 00:00:00 2001 From: netaques Date: Wed, 9 Dec 2020 18:20:46 +0100 Subject: [PATCH] Added non-generic version of EnableImplicitTypingFromPublic extension method --- .../ExtensionMethodsForImplicitTyping.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ExtendedXmlSerializer/ExtensionMethodsForImplicitTyping.cs b/src/ExtendedXmlSerializer/ExtensionMethodsForImplicitTyping.cs index f8d84f035..719fa574d 100644 --- a/src/ExtendedXmlSerializer/ExtensionMethodsForImplicitTyping.cs +++ b/src/ExtendedXmlSerializer/ExtensionMethodsForImplicitTyping.cs @@ -92,6 +92,19 @@ public static IConfigurationContainer EnableImplicitTypingFromAll(this IConfi public static IConfigurationContainer EnableImplicitTypingFromPublic(this IConfigurationContainer @this) => @this.EnableImplicitTyping(new PublicAssemblyTypes()); + /// + /// Convenience method to enable implicit typing on a container, using all found public types within the provided + /// subject type's assembly. All public types found within the provided subject type's assembly will be included and + /// registered as an implicit type. Use this with care and ensure that the names of all the public types found within + /// the assembly are unique. Otherwise, an exception will be thrown if more than one type share the same name. + /// + /// The configuration container to configure. + /// The subject type to query for type resolution. + /// The configured configuration container. + /// + public static IConfigurationContainer EnableImplicitTypingFromPublic(this IConfigurationContainer @this, Type type) + => @this.EnableImplicitTyping(new PublicAssemblyTypes(type)); + /// /// Convenience method to enable implicit typing on a container, using all found types within the provided subject /// type's namespace. All types found within the provided subject type's namespace will be included and registered as