Small updates to fix warnings + default top level statements
This commit is contained in:
4
files/.editorconfig
Normal file
4
files/.editorconfig
Normal file
@@ -0,0 +1,4 @@
|
||||
[*.cs]
|
||||
|
||||
# CS8714: The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
|
||||
dotnet_diagnostic.CS8714.severity = none
|
||||
@@ -4,11 +4,11 @@ using Domain;
|
||||
|
||||
namespace Wiring
|
||||
{
|
||||
public class Wiring : IAdapterResolver, IDisposable
|
||||
public class DomainWiring : IAdapterResolver, IDisposable
|
||||
{
|
||||
private readonly IContainer _container;
|
||||
|
||||
public Wiring()
|
||||
public DomainWiring()
|
||||
{
|
||||
_container = Wire();
|
||||
DomainPorts.SetResolver(this);
|
||||
@@ -44,16 +44,9 @@ namespace Wiring
|
||||
// builder.RegisterType<CacheService>().As<ICacheService>().SingleInstance();
|
||||
}
|
||||
|
||||
public T Resolve<T>()
|
||||
{
|
||||
return _container.Resolve<T>();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_container != null) {
|
||||
_container.Dispose();
|
||||
}
|
||||
}
|
||||
public T Resolve<T>() => _container.Resolve<T>();
|
||||
|
||||
public void Dispose() => _container?.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ dotnet add Wiring package Autofac
|
||||
#dotnet add WebApi reference Domain
|
||||
#dotnet add WebApi reference Wiring
|
||||
# console project
|
||||
dotnet new console -n ConsoleApp
|
||||
dotnet new console -n ConsoleApp --use-program-main
|
||||
dotnet sln add ConsoleApp
|
||||
dotnet add ConsoleApp reference Domain
|
||||
dotnet add ConsoleApp reference Wiring
|
||||
@@ -54,7 +54,8 @@ Pop-Location
|
||||
Copy-Item -Path "files/AssemblyInfo.cs" -Destination "$TargetFolder/Domain"
|
||||
Copy-Item -Path "files/DomainPorts.cs" -Destination "$TargetFolder/Domain"
|
||||
Copy-Item -Path "files/IAdapterResolver.cs" -Destination "$TargetFolder/Domain"
|
||||
Copy-Item -Path "files/Wiring.cs" -Destination "$TargetFolder/Wiring"
|
||||
Copy-Item -Path "files/DomainWiring.cs" -Destination "$TargetFolder/Wiring"
|
||||
Copy-Item -Path "files/.editorconfig" -Destination "$TargetFolder"
|
||||
|
||||
# remove unused files
|
||||
Remove-Item "$TargetFolder/Domain/Class1.cs" -ErrorAction Ignore
|
||||
|
||||
Reference in New Issue
Block a user