This commit is contained in:
2021-03-26 00:26:52 +01:00
commit 7ea63e50a3
6 changed files with 128 additions and 0 deletions

24
files/DomainPorts.cs Normal file
View File

@@ -0,0 +1,24 @@
using System;
namespace Domain
{
public static class DomainPorts
{
private static IAdapterResolver _resolver;
internal static T Resolve<T>()
{
if (_resolver == null) throw new NullReferenceException("Adapter resolver is not set!");
return _resolver.Resolve<T>();
}
public static void SetResolver(IAdapterResolver resolver)
{
_resolver = resolver;
}
// public static ILogService LogService => Resolve<ILogService>();
// public static IConfigService ConfigService => Resolve<IConfigService>();
// public static ICacheService CacheService => Resolve<ICacheService>();
}
}