25 lines
704 B
C#
25 lines
704 B
C#
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>();
|
|
}
|
|
}
|