using Autofac.Core; namespace OASystem.API.OAMethodLib { public class AutofacIocManager { public static AutofacIocManager Instance = new AutofacIocManager(); public ILifetimeScope Container { get; set; } public T GetService() { return ResolutionExtensions.Resolve((IComponentContext)(object)this.Container); } public T GetService(string serviceKey) { return ResolutionExtensions.ResolveKeyed((IComponentContext)(object)this.Container, (object)serviceKey); } public T GetService(string serviceKey, params Parameter[] parameters) { return ResolutionExtensions.ResolveKeyed((IComponentContext)(object)this.Container, (object)serviceKey, parameters); } public object GetService(Type serviceType) { return ResolutionExtensions.Resolve((IComponentContext)(object)this.Container, serviceType); } public object GetService(string serviceKey, Type serviceType) { return ResolutionExtensions.ResolveKeyed((IComponentContext)(object)this.Container, (object)serviceKey, serviceType); } public bool IsRegistered() { return ResolutionExtensions.IsRegistered((IComponentContext)(object)this.Container); } public bool IsRegistered(string serviceKey) { return ResolutionExtensions.IsRegisteredWithKey((IComponentContext)(object)this.Container, (object)serviceKey); } public bool IsRegistered(Type serviceType) { return ResolutionExtensions.IsRegistered((IComponentContext)(object)this.Container, serviceType); } public bool IsRegisteredWithKey(string serviceKey, Type serviceType) { return ResolutionExtensions.IsRegisteredWithKey((IComponentContext)(object)this.Container, (object)serviceKey, serviceType); } } }