IContainer.cs 599 B

123456789101112131415161718192021222324
  1. using System;
  2. namespace OpenSEMI.Core.Container
  3. {
  4. public interface IContainer : IServiceProvider
  5. {
  6. void Register<TService, TImplementation>() where TImplementation : TService;
  7. void Register<TService, TImplementation>(bool singleton) where TImplementation : TService;
  8. void Register<TService>(Type implementation, bool singleton);
  9. void Register<TService>(Type implementation, Action<TService> callback, bool singleton);
  10. void Register(Type service, Type implementation, bool singleton);
  11. void Register<TService>(TService instance);
  12. T Resolve<T>();
  13. bool IsRegistered<T>();
  14. }
  15. }