diff --git a/.csharpierrc b/.csharpierrc
new file mode 100644
index 0000000..c01826a
--- /dev/null
+++ b/.csharpierrc
@@ -0,0 +1,6 @@
+{
+ "printWidth": 200,
+ "useTabs": false,
+ "tabWidth": 4,
+ "preprocessorSymbolSets": ["", "DEBUG", "DEBUG,CODE_STYLE"]
+}
\ No newline at end of file
diff --git a/.filenesting.json b/.filenesting.json
new file mode 100644
index 0000000..0b71966
--- /dev/null
+++ b/.filenesting.json
@@ -0,0 +1,3 @@
+{
+ "help":"https://go.microsoft.com/fwlink/?linkid=866610"
+}
\ No newline at end of file
diff --git a/SmallInjector/Container.cs b/SmallInjector/Container.cs
index 770f27a..c3f8f91 100644
--- a/SmallInjector/Container.cs
+++ b/SmallInjector/Container.cs
@@ -1,98 +1,90 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
+namespace SmallInjector;
-namespace SmallInjector
+///
+/// A small dependency injector to demonstrate the pattern.
+///
+public class Container : IContainer
{
- ///
- /// A small dependency injector to demonstrate the pattern.
- ///
- public class Container : IContainer
+ private readonly Dictionary> _container = new();
+
+ ///
+ public void RegisterType(bool isSingleton, TService instance = default) where TService : TInterface
{
- private readonly Dictionary> _container = new Dictionary>();
-
- ///
- public void RegisterType(bool isSingleton, TService instance = default)
- where TService : TInterface
+ if (!IsRegistered())
{
- if (!IsRegistered())
- {
- _container[typeof(TInterface)] = new List
- {new RegisteredType(typeof(TService), isSingleton, null)};
- }
- else
- {
- _container[typeof(TInterface)].Add(new RegisteredType(typeof(TService), isSingleton, null));
- }
+ _container[typeof(TInterface)] = new List { new RegisteredType(typeof(TService), isSingleton, null) };
}
-
- ///
- public void RegisterType(bool isSingleton, TService instance = default) =>
- RegisterType(isSingleton, instance);
-
- ///
- public TService Resolve() => (TService) Resolve(typeof(TService));
-
- ///
- public bool IsRegistered() => IsRegistered(typeof(TService));
-
- ///
- public bool IsRegistered(Type serviceType) => _container.ContainsKey(serviceType);
-
- ///
- public IEnumerable