C# 클래스 QuizProjectMvc.Web.CommonConventions

파일 보기 프로젝트 열기: kidroca/project-quiz-mvc 1 사용 예제들

공개 메소드들

메소드 설명
RegisterAllImplementationsOfInterface ( Type>.Action registerMethod, Type interfaceTypes, Assembly implementationAssemblies, Type excludeTypes, string excludeRegEx ) : void

Registers all of the types that implement the passed in interfaceTypes with the DI container so they can be resolved as an IEnumerable{T} of values (where T is the interface type). This overload is for DI containers that allow the use of multiple registration method calls, one for each implementation of the interface.

RegisterAllImplementationsOfInterfaceSingle ( Action registerMethod, Type interfaceTypes, Assembly implementationAssemblies, Type excludeTypes, string excludeRegEx ) : void

Registers all of the types that implement the passed in interfaceTypes with the DI container so they can be resolved as an IEnumerable{T} of values (where T is the interface type). This overload is for DI containers that require the use of a multiple registration method call for all implementations a given interface.

RegisterDefaultConventions ( Type>.Action registerMethod, Assembly interfaceAssemblies, Assembly implementationAssemblies, Type excludeTypes, string excludeRegEx ) : void

Registers all single types in a set of assemblies that meet the following criteria: 1) The name of the type matches the interface name (I[TypeName] = [TypeName]) or 2) The name of the type matches the interface name + the suffix "Adapter" (I[TypeName] = [TypeName]Adapter) 3) The class does not have a string parameter in the constructor 4) The class is not decorated with the [ExcludeFromAutoRegistrationAttribute]

비공개 메소드들

메소드 설명
GetImplementationsOfInterface ( Assembly assembly, Type interfaceType ) : IEnumerable
GetInterfaces ( Assembly assembly ) : IEnumerable
IsAdapterType ( Type interfaceType, Type implementationType ) : bool
IsDefaultType ( Type interfaceType, Type implementationType ) : bool
IsExcludedType ( Type type ) : bool
IsExcludedType ( Type type, Type excludeTypes ) : bool
IsExcludedType ( Type type, Type excludeTypes, string excludeRegEx ) : bool
IsExcludedType ( Type type, string excludeRegEx ) : bool

메소드 상세

RegisterAllImplementationsOfInterface() 공개 정적인 메소드

Registers all of the types that implement the passed in interfaceTypes with the DI container so they can be resolved as an IEnumerable{T} of values (where T is the interface type). This overload is for DI containers that allow the use of multiple registration method calls, one for each implementation of the interface.
public static RegisterAllImplementationsOfInterface ( Type>.Action registerMethod, Type interfaceTypes, Assembly implementationAssemblies, Type excludeTypes, string excludeRegEx ) : void
registerMethod Type>.Action The method of the DI container used to register a single implementation, which will be /// called one time per implementation found to register each implementation of the type. Should be in the format /// (interfaceType, implementationType) => SomeMethod(interfaceType, implementationType) or similar.
interfaceTypes System.Type The interfaces to limit the registration to. If empty, no types will be registered.
implementationAssemblies System.Reflection.Assembly An array of assemblies to scan for the implementation types. /// This array should contain all of the assemblies where you have defined types that will be injected /// into MvcSiteMapProvider.
excludeTypes System.Type An array of used to manually exclude types if /// you intend to register them manually. Use this parameter if you want to inject your own implementation /// and therefore don't want the default type automatically registered.
excludeRegEx string A regular expression that can be used to exclude types based on the type /// name (excluding the namespace name). All types that match the regular expression will be excluded.
리턴 void

RegisterAllImplementationsOfInterfaceSingle() 공개 정적인 메소드

Registers all of the types that implement the passed in interfaceTypes with the DI container so they can be resolved as an IEnumerable{T} of values (where T is the interface type). This overload is for DI containers that require the use of a multiple registration method call for all implementations a given interface.
public static RegisterAllImplementationsOfInterfaceSingle ( Action registerMethod, Type interfaceTypes, Assembly implementationAssemblies, Type excludeTypes, string excludeRegEx ) : void
registerMethod Action The method of the DI container used to register an array of implementations, which will be /// called only one time to register all of the implementations of the type. Should be in the format /// (interfaceType, implementationTypes) => SomeMethod(interfaceType, implementationTypes) or similar, where /// implementationTypes is a .
interfaceTypes System.Type The interfaces to limit the registration to. If empty, no types will be registered.
implementationAssemblies System.Reflection.Assembly An array of assemblies to scan for the implementation types. /// This array should contain all of the assemblies where you have defined types that will be injected /// into MvcSiteMapProvider.
excludeTypes System.Type An array of used to manually exclude types if /// you intend to register them manually. Use this parameter if you want to inject your own implementation /// and therefore don't want the default type automatically registered.
excludeRegEx string A regular expression that can be used to exclude types based on the type /// name (excluding the namespace name). All types that match the regular expression will be excluded.
리턴 void

RegisterDefaultConventions() 공개 정적인 메소드

Registers all single types in a set of assemblies that meet the following criteria: 1) The name of the type matches the interface name (I[TypeName] = [TypeName]) or 2) The name of the type matches the interface name + the suffix "Adapter" (I[TypeName] = [TypeName]Adapter) 3) The class does not have a string parameter in the constructor 4) The class is not decorated with the [ExcludeFromAutoRegistrationAttribute]
public static RegisterDefaultConventions ( Type>.Action registerMethod, Assembly interfaceAssemblies, Assembly implementationAssemblies, Type excludeTypes, string excludeRegEx ) : void
registerMethod Type>.Action The method on the DI container used to register a type to an abstraction. /// Should be in the format (interfaceType, implementationType) => SomeMethod(interfaceType, implementationType) /// or similar.
interfaceAssemblies System.Reflection.Assembly An array of assemblies to scan for the interface types. These assemblies /// must be referenced within this project. Typically, you will just want to use the MvcSiteMapProvider /// assembly unless you decide to use throughout your project.
implementationAssemblies System.Reflection.Assembly An array of assemblies to scan for the implementation types. /// This array should contain all of the assemblies where you have defined types that will be injected /// into MvcSiteMapProvider.
excludeTypes System.Type An array of used to manually exclude types if /// you intend to register them manually. Use this parameter if you want to inject your own implementation /// and therefore don't want the default type automatically registered.
excludeRegEx string A regular expression that can be used to exclude types based on the type /// name (excluding the namespace name). All types that match the regular expression will be excluded.
리턴 void