Ejemplo n.º 1
0
 public void Configuration(IAppBuilder app)
 {
     ContainerOptions containerOptions = new ContainerOptions();
     Container container = new Container(containerOptions);
     container.InstallIrisDependency();
     var hubConfig = new Microsoft.AspNet.SignalR.HubConfiguration()
     {
         EnableCrossDomain = true,
         Resolver = new SimpleInjectorSignalR(container)
     };
     app.MapHubs("/server",hubConfig);
 }
Ejemplo n.º 2
0
        /// <summary>Initializes a new instance of the <see cref="Container"/> class.</summary>
        /// <param name="options">The container options.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="options"/> is a null
        /// reference.</exception>
        /// <exception cref="ArgumentException">Thrown when supplied <paramref name="options"/> is an instance
        /// that already is supplied to another <see cref="Container"/> instance. Every container must get
        /// its own <see cref="ContainerOptions"/> instance.</exception>
        public Container(ContainerOptions options)
        {
            Requires.IsNotNull(options, "options");

            if (options.Container != null)
            {
                throw new ArgumentException(StringResources.ContainerOptionsBelongsToAnotherContainer(),
                    "options");
            }
            
            options.Container = this;
            this.Options = options;

            this.RegisterSingle<Container>(this);

            this.containerId = Interlocked.Increment(ref counter);

            this.SelectionBasedLifestyle = new LifestyleSelectionBehaviorProxyLifestyle(options);
        }
Ejemplo n.º 3
0
 private static void RegisterParameterConventionInternal(ContainerOptions options, IParameterConvention convention)
 {
     options.DependencyInjectionBehavior = new ConventionDependencyInjectionBehavior(
         options.DependencyInjectionBehavior, convention);
 }
Ejemplo n.º 4
0
 public Container(ContainerOptions options)
 {
     throw new InvalidOperationException(
               "This method is not supported anymore. Please use Container.Options to configure the container.");
 }