Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 3
0
 public AutofacBuilder(AutofacOptions options)
 {
     _options = options;
 }
Exemplo n.º 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;
 }
Exemplo n.º 5
0
 public AutofacBuilder(AutofacOptions options)
 {
     _options = options;
 }