예제 #1
0
        /// <summary>
        /// Use the KickStart extension to configure Ninject.
        /// </summary>
        /// <param name="configurationBuilder">The configuration builder.</param>
        /// <param name="configure">The <see langword="delegate"/> to configure Ninject options.</param>
        /// <returns>
        /// A fluent <see langword="interface"/> to configure KickStart.
        /// </returns>
        public static IConfigurationBuilder UseNinject(this IConfigurationBuilder configurationBuilder, Action<INinjectBuilder> configure)
        {
            var options = new NinjectOptions();
            var service = new NinjectStarter(options);

            if (configure != null)
            {
                var builder = new NinjectBuilder(options);
                configure(builder);
            }

            configurationBuilder.ExcludeName("Ninject");
            configurationBuilder.Use(service);

            return configurationBuilder;
        }
예제 #2
0
 public NinjectStarter(NinjectOptions options)
 {
     _options = options;
 }
예제 #3
0
 public NinjectBuilder(NinjectOptions options)
 {
     _options = options;
 }