code cleanup

This commit is contained in:
2022-11-13 14:32:56 +01:00
parent 9f4e76fa4c
commit 32cc67b25a
7 changed files with 56 additions and 118 deletions

View File

@ -1,7 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
namespace SmallInjector

View File

@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
namespace SmallInjector
{
/// <summary>
/// Wrapper for Service Locator
/// </summary>
public class ServiceLocatorWrapper : CommonServiceLocator.ServiceLocatorImplBase
{
private readonly IContainer _container;
/// <summary>
/// Creates new <see cref="ServiceLocatorWrapper"/> instance
/// </summary>
public ServiceLocatorWrapper(IContainer container)
{
_container = container;
}
/// <inheritdoc />
protected override object DoGetInstance(Type serviceType, string key) => _container.Resolve(serviceType);
/// <inheritdoc />
protected override IEnumerable<object> DoGetAllInstances(Type serviceType) => _container.ResolveAny(serviceType);
}
}

View File

@ -2,18 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\debug\SmallInjector.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\release\SmallInjector.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommonServiceLocator" Version="2.0.4" />
</ItemGroup>
</Project>