/// <summary>
        /// Use the KickStart extension to configure Autofac.
        /// </summary>
        /// <param name="configurationBuilder">The configuration builder.</param>
        /// <param name="configure">The <see langword="delegate"/> to configure Autofac options.</param>
        /// <returns>
        /// A fluent <see langword="interface" /> to configure KickStart.
        /// </returns>
        public static IConfigurationBuilder UseAutofac(this IConfigurationBuilder configurationBuilder, Action<IAutofacBuilder> configure)
        {
            var options = new AutofacOptions();
            var service = new AutofacStarter(options);

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

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

            return configurationBuilder;
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AutofacStarter"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 public AutofacStarter(AutofacOptions options)
 {
     _options = options;
 }
Example #3
0
 public AutofacBuilder(AutofacOptions options)
 {
     _options = options;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AutofacStarter"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 public AutofacStarter(AutofacOptions options)
 {
     _options = options;
 }
Example #5
0
 public AutofacBuilder(AutofacOptions options)
 {
     _options = options;
 }