Skip to content

Commit

Permalink
Added non-generic version of EnableImplicitTypingFromPublic extension…
Browse files Browse the repository at this point in the history
… method
  • Loading branch information
onetocny committed Dec 10, 2020
1 parent a6263e4 commit 251102e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ExtendedXmlSerializer/ExtensionMethodsForImplicitTyping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@ public static IConfigurationContainer EnableImplicitTypingFromAll<T>(this IConfi
public static IConfigurationContainer EnableImplicitTypingFromPublic<T>(this IConfigurationContainer @this)
=> @this.EnableImplicitTyping(new PublicAssemblyTypes<T>());

/// <summary>
/// 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.
/// </summary>
/// <param name="this">The configuration container to configure.</param>
/// <param name="type">The subject type to query for type resolution.</param>
/// <returns>The configured configuration container.</returns>
/// <seealso cref="EnableImplicitTyping(IConfigurationContainer,System.Type[])"/>
public static IConfigurationContainer EnableImplicitTypingFromPublic(this IConfigurationContainer @this, Type type)
=> @this.EnableImplicitTyping(new PublicAssemblyTypes(type));

/// <summary>
/// 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
Expand Down

0 comments on commit 251102e

Please sign in to comment.