ResolveTypes() public method

Resolves all instances of the type registered on the service.
Note that the actual implementation lays in the hands of the IoC technique being used.
The is null.
public ResolveTypes ( Type serviceType ) : IEnumerable
serviceType System.Type The type of the service.
return IEnumerable
コード例 #1
0
ファイル: ServiceLocatorFacts.cs プロジェクト: pars87/Catel
 public void ReturnsAllAvaliableInstances()
 {
     var serviceLocator = new ServiceLocator { AutoRegisterTypesViaAttributes = true };
     serviceLocator.RegisterInstance(typeof(IFooService), new FooService2(), "FooService3");
     Assert.AreEqual(3, serviceLocator.ResolveTypes<IFooService>().Count());
 }