Skip to content

Commit

Permalink
Remove already existing internal WithMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
romerod committed Dec 9, 2021
1 parent 2b1acdb commit 4816f0a
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,23 +251,6 @@ public static IRegistrationBuilder<TLimit, OpenGenericScanningActivatorData, TRe
.As(candidateType => (Service)new KeyedService(serviceKeyMapping(candidateType), candidateType));
}

/// <summary>
/// Specify how an open generic type from a scanned assembly provides metadata.
/// </summary>
/// <typeparam name="TLimit">Registration limit type.</typeparam>
/// <typeparam name="TRegistrationStyle">Registration style.</typeparam>
/// <param name="registration">Registration to set metadata on.</param>
/// <param name="metadataMapping">A function mapping the type to a list of metadata items.</param>
/// <returns>Registration builder allowing the registration to be configured.</returns>
public static IRegistrationBuilder<TLimit, OpenGenericScanningActivatorData, TRegistrationStyle>
WithMetadata<TLimit, TRegistrationStyle>(
this IRegistrationBuilder<TLimit, OpenGenericScanningActivatorData, TRegistrationStyle> registration,
Func<Type, IEnumerable<KeyValuePair<string, object?>>> metadataMapping)
{
registration.ActivatorData.ConfigurationActions.Add((t, rb) => rb.WithMetadata(metadataMapping(t)));
return registration;
}

/// <summary>
/// Use the properties of an attribute (or interface implemented by an attribute) on the scanned type
/// to provide metadata values.
Expand Down

0 comments on commit 4816f0a

Please sign in to comment.