diff --git a/LightweightIocContainer/EnumerableExtension.cs b/LightweightIocContainer/EnumerableExtension.cs
index efd7c62..b2bd14f 100644
--- a/LightweightIocContainer/EnumerableExtension.cs
+++ b/LightweightIocContainer/EnumerableExtension.cs
@@ -43,13 +43,7 @@ namespace LightweightIocContainer
{
try
{
- TSource first;
- if (predicate == null)
- first = source.First();
- else
- first = source.First(predicate);
-
- return first;
+ return predicate == null ? source.First() : source.First(predicate);
}
catch (Exception)
{
diff --git a/LightweightIocContainer/Exceptions/CircularDependencyException.cs b/LightweightIocContainer/Exceptions/CircularDependencyException.cs
index 95f842e..9047db7 100644
--- a/LightweightIocContainer/Exceptions/CircularDependencyException.cs
+++ b/LightweightIocContainer/Exceptions/CircularDependencyException.cs
@@ -44,7 +44,7 @@ namespace LightweightIocContainer.Exceptions
{
get
{
- StringBuilder message = new StringBuilder($"Circular dependency has been detected when trying to resolve `{ResolvingType}`.\n");
+ StringBuilder message = new($"Circular dependency has been detected when trying to resolve `{ResolvingType}`.\n");
if (ResolveStack == null || !ResolveStack.Any())
return message.ToString();
@@ -52,9 +52,7 @@ namespace LightweightIocContainer.Exceptions
message.Append($"\t`{ResolvingType}` resolved as dependency of\n");
for (int i = ResolveStack.Count - 1; i >= 1 ; i--)
- {
message.Append($"\t`{ResolveStack[i]}` resolved as dependency of\n");
- }
message.Append($"\t`{ResolveStack[0]}` which is the root type being resolved.");
return message.ToString();
diff --git a/LightweightIocContainer/Exceptions/IocContainerException.cs b/LightweightIocContainer/Exceptions/IocContainerException.cs
index 2023355..dada45e 100644
--- a/LightweightIocContainer/Exceptions/IocContainerException.cs
+++ b/LightweightIocContainer/Exceptions/IocContainerException.cs
@@ -38,7 +38,7 @@ namespace LightweightIocContainer.Exceptions
/// The inner
protected IocContainerException(string message, Exception innerException)
: base(message, innerException) =>
- InnerExceptions = new List() {innerException};
+ InnerExceptions = new List {innerException};
///
/// The inner exceptions of the
diff --git a/LightweightIocContainer/Factories/TypedFactory.cs b/LightweightIocContainer/Factories/TypedFactory.cs
index 90808c3..c68cb23 100644
--- a/LightweightIocContainer/Factories/TypedFactory.cs
+++ b/LightweightIocContainer/Factories/TypedFactory.cs
@@ -3,7 +3,6 @@
// Copyright(c) 2019 SimonG. All Rights Reserved.
using System;
-using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
diff --git a/LightweightIocContainer/Installers/AssemblyInstaller.cs b/LightweightIocContainer/Installers/AssemblyInstaller.cs
index 89a1e6f..af63a20 100644
--- a/LightweightIocContainer/Installers/AssemblyInstaller.cs
+++ b/LightweightIocContainer/Installers/AssemblyInstaller.cs
@@ -45,9 +45,7 @@ namespace LightweightIocContainer.Installers
public void Install(IIocContainer container)
{
foreach (IIocInstaller installer in Installers)
- {
installer.Install(container);
- }
}
}
}
\ No newline at end of file
diff --git a/LightweightIocContainer/Interfaces/IIocContainer.cs b/LightweightIocContainer/Interfaces/IIocContainer.cs
index 802184c..141cdfb 100644
--- a/LightweightIocContainer/Interfaces/IIocContainer.cs
+++ b/LightweightIocContainer/Interfaces/IIocContainer.cs
@@ -36,8 +36,7 @@ namespace LightweightIocContainer.Interfaces
/// The open generic Type that implements the interface
/// The for this
/// The created
- IOpenGenericRegistration RegisterOpenGenerics(Type tInterface, Type tImplementation,
- Lifestyle lifestyle = Lifestyle.Transient);
+ IOpenGenericRegistration RegisterOpenGenerics(Type tInterface, Type tImplementation, Lifestyle lifestyle = Lifestyle.Transient);
///
/// Register multiple interfaces for a that implements them
diff --git a/LightweightIocContainer/IocContainer.cs b/LightweightIocContainer/IocContainer.cs
index 4c47991..60ed864 100644
--- a/LightweightIocContainer/IocContainer.cs
+++ b/LightweightIocContainer/IocContainer.cs
@@ -25,8 +25,8 @@ namespace LightweightIocContainer
{
private readonly RegistrationFactory _registrationFactory;
- private readonly List<(Type type, object instance)> _singletons = new List<(Type, object)>();
- private readonly List<(Type type, Type scope, ConditionalWeakTable