C# 클래스 MvcApi.ServicesContainer

상속: IDependencyResolver, IDisposable
파일 보기 프로젝트 열기: dax70/MvcApi

공개 메소드들

메소드 설명
Add ( Type serviceType, object service ) : void

Adds a service to the end of services list for the given service type.

AddRange ( Type serviceType, IEnumerable services ) : void

Adds the services of the specified collection to the end of the services list for the given service type.

Clear ( Type serviceType ) : void

Removes all the service instances of the given service type.

FindIndex ( Type serviceType, Predicate match ) : int

Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence.

GetService ( Type serviceType ) : object
GetServices ( Type serviceType ) : IEnumerable
Insert ( Type serviceType, int index, object service ) : void

Inserts a service into the collection at the specified index.

InsertRange ( Type serviceType, int index, IEnumerable services ) : void

Inserts the elements of the collection into the service list at the specified index.

IsSingleService ( Type serviceType ) : bool

Determine whether the service type should be fetched with GetService or GetServices.

Remove ( Type serviceType, object service ) : bool

Removes the first occurrence of the given service from the service list for the given service type.

RemoveAll ( Type serviceType, Predicate match ) : int

Removes all the elements that match the conditions defined by the specified predicate.

RemoveAt ( Type serviceType, int index ) : void

Removes the service at the specified index.

Replace ( Type serviceType, object service ) : void

Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services.

ReplaceRange ( Type serviceType, IEnumerable services ) : void

Replaces all existing services for the given service type with the given service instances.

보호된 메소드들

메소드 설명
ClearMultiple ( Type serviceType ) : void
ClearSingle ( Type serviceType ) : void
ReplaceMultiple ( Type serviceType, object service ) : void
ReplaceSingle ( Type serviceType, object service ) : void
ResetCache ( Type serviceType ) : void

비공개 메소드들

메소드 설명
Dispose ( ) : void
GetServiceInstances ( Type serviceType ) : List

메소드 상세

Add() 공개 메소드

Adds a service to the end of services list for the given service type.
public Add ( Type serviceType, object service ) : void
serviceType System.Type The service type.
service object The service instance.
리턴 void

AddRange() 공개 메소드

Adds the services of the specified collection to the end of the services list for the given service type.
public AddRange ( Type serviceType, IEnumerable services ) : void
serviceType System.Type The service type.
services IEnumerable The services to add.
리턴 void

Clear() 공개 메소드

Removes all the service instances of the given service type.
public Clear ( Type serviceType ) : void
serviceType System.Type The service type to clear from the services list.
리턴 void

ClearMultiple() 보호된 메소드

protected ClearMultiple ( Type serviceType ) : void
serviceType System.Type
리턴 void

ClearSingle() 보호된 추상적인 메소드

protected abstract ClearSingle ( Type serviceType ) : void
serviceType System.Type
리턴 void

FindIndex() 공개 메소드

Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence.
public FindIndex ( Type serviceType, Predicate match ) : int
serviceType System.Type The service type.
match Predicate The delegate that defines the conditions of the element /// to search for.
리턴 int

GetService() 공개 추상적인 메소드

public abstract GetService ( Type serviceType ) : object
serviceType System.Type
리턴 object

GetServices() 공개 추상적인 메소드

public abstract GetServices ( Type serviceType ) : IEnumerable
serviceType System.Type
리턴 IEnumerable

Insert() 공개 메소드

Inserts a service into the collection at the specified index.
public Insert ( Type serviceType, int index, object service ) : void
serviceType System.Type The service type.
index int The zero-based index at which the service should be inserted. /// If is passed, ensures the element is added to the end.
service object The service to insert.
리턴 void

InsertRange() 공개 메소드

Inserts the elements of the collection into the service list at the specified index.
public InsertRange ( Type serviceType, int index, IEnumerable services ) : void
serviceType System.Type The service type.
index int The zero-based index at which the new elements should be inserted. /// If is passed, ensures the elements are added to the end.
services IEnumerable The collection of services to insert.
리턴 void

IsSingleService() 공개 추상적인 메소드

Determine whether the service type should be fetched with GetService or GetServices.
public abstract IsSingleService ( Type serviceType ) : bool
serviceType System.Type type of service to query
리턴 bool

Remove() 공개 메소드

Removes the first occurrence of the given service from the service list for the given service type.
public Remove ( Type serviceType, object service ) : bool
serviceType System.Type The service type.
service object The service instance to remove.
리턴 bool

RemoveAll() 공개 메소드

Removes all the elements that match the conditions defined by the specified predicate.
public RemoveAll ( Type serviceType, Predicate match ) : int
serviceType System.Type The service type.
match Predicate The delegate that defines the conditions of the elements to remove.
리턴 int

RemoveAt() 공개 메소드

Removes the service at the specified index.
public RemoveAt ( Type serviceType, int index ) : void
serviceType System.Type The service type.
index int The zero-based index of the service to remove.
리턴 void

Replace() 공개 메소드

Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services.
public Replace ( Type serviceType, object service ) : void
serviceType System.Type The service type.
service object The service instance.
리턴 void

ReplaceMultiple() 보호된 메소드

protected ReplaceMultiple ( Type serviceType, object service ) : void
serviceType System.Type
service object
리턴 void

ReplaceRange() 공개 메소드

Replaces all existing services for the given service type with the given service instances.
public ReplaceRange ( Type serviceType, IEnumerable services ) : void
serviceType System.Type The service type.
services IEnumerable The service instances.
리턴 void

ReplaceSingle() 보호된 추상적인 메소드

protected abstract ReplaceSingle ( Type serviceType, object service ) : void
serviceType System.Type
service object
리턴 void

ResetCache() 보호된 메소드

protected ResetCache ( Type serviceType ) : void
serviceType System.Type
리턴 void