ServiceContainerFactory.cs 971 B

12345678910111213141516171819202122232425262728
  1. namespace Wayne.Lib
  2. {
  3. /// <summary>
  4. /// Factory to create ServiceContainer.
  5. /// </summary>
  6. public static class ServiceContainerFactory
  7. {
  8. /// <summary>
  9. /// Creates new service container.
  10. /// </summary>
  11. /// <returns>New service container.</returns>
  12. public static IServiceContainer Create()
  13. {
  14. return new ServiceContainer();
  15. }
  16. /// <summary>
  17. /// Creates new service container with a parent service locator from where the newly created service container
  18. /// can look for services if it does not find them in its own container.
  19. /// </summary>
  20. /// <param name="parentServiceLocator">Parent service container.</param>
  21. /// <returns>New service container.</returns>
  22. public static IServiceContainer Create(IServiceLocator parentServiceLocator)
  23. {
  24. return new ServiceContainer(parentServiceLocator);
  25. }
  26. }
  27. }