diff options
author | vnugent <public@vaughnnugent.com> | 2024-01-06 13:09:27 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-01-06 13:09:27 -0500 |
commit | 778ece00a279b176636f9a4314cd20bf7867793c (patch) | |
tree | 7b47afa4bf991ae4a05d1afa92e980205f32a013 /lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs | |
parent | 0dc5bebe5073d9c5bcea2b567b2bef75ac86f1ff (diff) |
initial migration to .net 8.0
Diffstat (limited to 'lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs')
-rw-r--r-- | lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs b/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs index 235aaf6..979ade2 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs @@ -373,21 +373,6 @@ namespace VNLib.Plugins.Extensions.Loading } /// <summary> - /// Adds a service to the <see cref="IServiceContainer"/> using generics syntax - /// </summary> - /// <typeparam name="T"></typeparam> - /// <param name="container"></param> - /// <param name="service">The service instance to add to the container</param> - /// <exception cref="ArgumentNullException"></exception> - public static void AddService<T>(this IServiceContainer container, T service) - { - _ = container ?? throw new ArgumentNullException(nameof(container)); - _ = service ?? throw new ArgumentNullException(nameof(service)); - - container.AddService(typeof(T), service); - } - - /// <summary> /// Creates a new instance of the desired service type from an external assembly and /// caches the loaded assembly so it's never loaded more than once. Managed assembly /// life cycles are managed by the plugin. Instances are treated as services and @@ -433,7 +418,12 @@ namespace VNLib.Plugins.Extensions.Loading } /// <summary> - /// + /// Exports a service of the desired type to the host application. Once the plugin + /// is done loading, the host will be able to access the service instance. + /// <para> + /// You should avoid mutating the service instance after the plugin has been + /// loaded, especially if you are using factory methods to create the service. + /// </para> /// </summary> /// <typeparam name="T"></typeparam> /// <param name="plugin"></param> |