View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |   CAT.EXTENSIONS   |

Code Reference

» Cat.ServiceCollection.Extensions Assembly » Cat.ServiceCollection.Extensions Namespace » ServiceCollectionExtensions Class

ServiceCollectionExtensions.HasRegistrationFor Method

Overloads  
HasRegistrationFor(this IServiceCollection, Type) Checks whether the given service type is already registered in the service collection. An open generic type (such as typeof(IRepository<>)) matches any registration for that generic definition.
HasRegistrationFor<TService>(this IServiceCollection) Checks whether TService is already registered in the service collection.

ServiceCollectionExtensions.HasRegistrationFor(this IServiceCollection, Type) Method

Checks whether the given service type is already registered in the service collection. An open generic type (such as typeof(IRepository<>)) matches any registration for that generic definition.

public static bool HasRegistrationFor(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Type serviceType);

Parameters

services Microsoft.Extensions.DependencyInjection.IServiceCollection

The service collection to check.

serviceType System.Type

The service type to look for.

Returns

System.Boolean
true if a matching registration exists.

ServiceCollectionExtensions.HasRegistrationFor<TService>(this IServiceCollection) Method

Checks whether TService is already registered in the service collection.

public static bool HasRegistrationFor<TService>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);

Type parameters

TService

The service type to look for.

Parameters

services Microsoft.Extensions.DependencyInjection.IServiceCollection

The service collection to check.

Returns

System.Boolean
true if a registration for TService exists.