diff --git a/LightweightIocContainer/Interfaces/IIocContainer.cs b/LightweightIocContainer/Interfaces/IIocContainer.cs
index dc2b850..f2ecd6a 100644
--- a/LightweightIocContainer/Interfaces/IIocContainer.cs
+++ b/LightweightIocContainer/Interfaces/IIocContainer.cs
@@ -57,5 +57,12 @@ namespace LightweightIocContainer.Interfaces
///
/// The to clear the multiton instances
void ClearMultitonInstances();
+
+ ///
+ /// Is the given registered with this
+ ///
+ /// The given
+ /// True if the given is registered with this , false if not
+ bool IsTypeRegistered();
}
}
\ No newline at end of file
diff --git a/LightweightIocContainer/IocContainer.cs b/LightweightIocContainer/IocContainer.cs
index d25117a..34e92e1 100644
--- a/LightweightIocContainer/IocContainer.cs
+++ b/LightweightIocContainer/IocContainer.cs
@@ -284,6 +284,13 @@ namespace LightweightIocContainer
_multitons.Remove(multitonInstance);
}
+ ///
+ /// Is the given registered with this
+ ///
+ /// The given
+ /// True if the given is registered with this , false if not
+ public bool IsTypeRegistered() => _registrations.Any(registration => registration.InterfaceType == typeof(T));
+
///
/// The method
///
diff --git a/LightweightIocContainer/LightweightIocContainer.xml b/LightweightIocContainer/LightweightIocContainer.xml
index c13c92a..46a5869 100644
--- a/LightweightIocContainer/LightweightIocContainer.xml
+++ b/LightweightIocContainer/LightweightIocContainer.xml
@@ -254,6 +254,13 @@
The to clear the multiton instances
+
+
+ Is the given registered with this
+
+ The given
+ True if the given is registered with this , false if not
+
An that installs all s for its given
@@ -437,6 +444,13 @@
The to clear the multiton instances
+
+
+ Is the given registered with this
+
+ The given
+ True if the given is registered with this , false if not
+
The method
diff --git a/Test.LightweightIocContainer/IocContainerTest.cs b/Test.LightweightIocContainer/IocContainerTest.cs
index f0cf55b..9f91850 100644
--- a/Test.LightweightIocContainer/IocContainerTest.cs
+++ b/Test.LightweightIocContainer/IocContainerTest.cs
@@ -355,5 +355,14 @@ namespace Test.LightweightIocContainer
Assert.AreNotSame(resolvedTest2, resolvedTest4);
Assert.AreNotSame(resolvedTest3, resolvedTest5);
}
+
+ [Test]
+ public void TestIsTypeRegistered()
+ {
+ Assert.False(_iocContainer.IsTypeRegistered());
+
+ _iocContainer.Register(RegistrationFactory.Register());
+ Assert.True(_iocContainer.IsTypeRegistered());
+ }
}
}
\ No newline at end of file