Ejemplo n.º 1
0
 /// <summary>
 /// Add an extension object to the container.
 /// </summary>
 /// <param name="extension"><see cref="IServiceContainerExtension"/> to add.</param>
 /// <returns>The <see cref="IServiceContainer"/> object that this method was called on.</returns>
 public virtual IServiceContainer AddExtension(IServiceContainerExtension extension)
 {
     if (_extensions == null)
     {
         throw new ObjectDisposedException("container");
     }
     if (extension == null)
     {
         throw new ArgumentNullException(nameof(extension));
     }
     _extensions.Add(extension);
     extension.Initialize(this);
     return(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Add an extension object to the container.
 /// </summary>
 /// <param name="extension"><see cref="IServiceContainerExtension"/> to add.</param>
 /// <returns>The <see cref="IServiceContainer"/> object that this method was called on.</returns>
 public IServiceContainer AddExtension(IServiceContainerExtension extension)
 {
     _container.AddExtension(extension);
     return(this);
 }