cherry-pick Misc/obsolete redundant extension (#11838)
* Mark AddUnique<TImplementing> obsolete. * Remove all internal usages of AddUnique<TImplementing>.
This commit is contained in:
committed by
Paul Johnson
parent
11eaf176a9
commit
8d1fa717ba
@@ -24,6 +24,8 @@ namespace Umbraco.Extensions
|
||||
services.AddUnique<TService2>(factory => (TImplementing)factory.GetRequiredService<TService1>());
|
||||
}
|
||||
|
||||
// TODO(V11): Remove this function.
|
||||
[Obsolete("This method is functionally equivalent to AddSingleton<TImplementing>() please use that instead.")]
|
||||
public static void AddUnique<TImplementing>(this IServiceCollection services)
|
||||
where TImplementing : class
|
||||
=> services.Replace(ServiceDescriptor.Singleton<TImplementing, TImplementing>());
|
||||
|
||||
Reference in New Issue
Block a user