diff --git a/Extensions/XDIKeyedServiceExtensions.cs b/Extensions/XDIKeyedServiceExtensions.cs
index aae16cb..7829034 100644
--- a/Extensions/XDIKeyedServiceExtensions.cs
+++ b/Extensions/XDIKeyedServiceExtensions.cs
@@ -2,10 +2,14 @@ using System;
using System.Linq;
using xExceptions.Models;
using xExceptions.Constants;
+using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
namespace xCommons.Extensions
{
+ //
+ #region Requirements ...
///
/// an Internal Class for Registering Keyed Services ...
///
@@ -32,13 +36,549 @@ namespace xCommons.Extensions
}
}
+ ///
+ /// Holds the registration metadata for a keyed service.
+ ///
+ internal sealed class XKeyedServiceRegistration
+ where TService : class
+ {
+ public string Key { get; private set; }
+ public bool OwnsInstance { get; private set; }
+ public ServiceLifetime Lifetime { get; private set; }
+ public Func Factory { get; private set; }
+
+ public XKeyedServiceRegistration(
+ string key,
+ Func factory,
+ ServiceLifetime lifetime,
+ bool ownsInstance
+ )
+ {
+ //
+ Key = key;
+ Factory = factory;
+ Lifetime = lifetime;
+ OwnsInstance = ownsInstance;
+ }
+ }
+
+ ///
+ /// Reference equality comparer used to avoid disposing the same object twice.
+ /// Compatible with .NET Standard 2.0.
+ ///
+ internal sealed class XReferenceEqualityComparer : IEqualityComparer