C# Class Patterns.Autofac.Sources.ResolveCreatableSource

Provides an IRegistrationSource implementation that always builds new registrations for creatable types, negating the need to pre-register them. Interfaces and abstract classes will still need to be registered in the normal way.
Using this class can have unwanted side effects and is intended for fringe scenarios; use with caution.
Inheritance: IRegistrationSource
Show file Open project: patterns-group/code-patterns

Public Methods

Method Description
RegistrationsFor ( Autofac.Core.Service service, Func registrationAccessor ) : IEnumerable

Retrieves registrations for an unregistered service, to be used by the container. If service is a creatable type, a new registration will be created; otherwise, an empty enumerable is returned.

Method Details

RegistrationsFor() public method

Retrieves registrations for an unregistered service, to be used by the container. If service is a creatable type, a new registration will be created; otherwise, an empty enumerable is returned.
public RegistrationsFor ( Autofac.Core.Service service, Func registrationAccessor ) : IEnumerable
service Autofac.Core.Service The service that was requested.
registrationAccessor Func A function that will return existing registrations for a service.
return IEnumerable