Fix errors

This commit is contained in:
Nikolaj Geisle
2022-02-21 12:49:17 +01:00
parent cb44dc70f3
commit 57f32100cb
8 changed files with 24 additions and 10 deletions

View File

@@ -7,6 +7,20 @@ namespace Umbraco.Extensions
{
public static class ServiceCollectionExtensions
{
/// <summary>
/// Adds a service of type <typeparamref name="TService"/> with an implementation type of <typeparamref name="TImplementing"/> to the specified <see cref="IServiceCollection"/>.
/// </summary>
/// <remarks>
/// Removes all previous registrations for the type <typeparamref name="TService"/>.
/// </remarks>
public static void AddUnique<TService, TImplementing>(
this IServiceCollection services)
where TService : class
where TImplementing : class, TService
{
AddUnique<TService, TImplementing>(services, ServiceLifetime.Singleton);
}
/// <summary>
/// Adds a service of type <typeparamref name="TService"/> with an implementation type of <typeparamref name="TImplementing"/> to the specified <see cref="IServiceCollection"/>.
/// </summary>
@@ -15,7 +29,7 @@ namespace Umbraco.Extensions
/// </remarks>
public static void AddUnique<TService, TImplementing>(
this IServiceCollection services,
ServiceLifetime lifetime = ServiceLifetime.Singleton)
ServiceLifetime lifetime)
where TService : class
where TImplementing : class, TService
{