/// <summary>
        /// Creates a new hub instance.
        /// </summary>
        /// <param name="descriptor">The hub descriptor that contains information about the <see cref="Hub"/> to create.</param>
        /// <returns>A <see cref="Hub"/> instance.</returns>
        public IHub Create(HubDescriptor descriptor)
        {
            serviceFactory.BeginScope();
            var hub = (IHub)serviceFactory.GetInstance(descriptor.HubType);

            return(hub);
        }
Esempio n. 2
0
 public IDependencyScope BeginScope()
 {
     if (marker.ScopeCreated)
     {
         return(new LightInjectDependencyScope(serviceFactory, marker));
     }
     else
     {
         var scope     = serviceFactory.BeginScope();
         var newMarker = scope.GetInstance <IMarker>();
         newMarker.ScopeCreated = true;
         return(new LightInjectDependencyScope(scope, newMarker));
     }
 }
 public IJobServiceScope CreateScope()
 {
     return(new DefaultJobServiceScope(_factory.BeginScope()));
 }
Esempio n. 4
0
 public IIocResolverScope CreateScopeResolver()
 {
     return(new IocResolverScope(_serviceFactory.BeginScope()));
 }
Esempio n. 5
0
 private static object Create(Type type, IServiceFactory factory)
 {
     using var scope = factory.BeginScope();
     return(scope.Create(type));
 }
Esempio n. 6
0
        /// <inheritdoc/>
        public IServiceScope CreateScope()
        {
            var scope = container.BeginScope();

            return(new LightInjectServiceScope(scope));
        }