You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
using System.Collections.Immutable;
|
|
|
|
namespace Connected.Configuration
|
|
{
|
|
public static class RegisteredServices
|
|
{
|
|
private static readonly List<Type> _services;
|
|
private static readonly List<Type> _serviceOperations;
|
|
private static readonly List<Type> _arguments;
|
|
private static readonly List<Type> _middleware;
|
|
private static readonly List<Type> _entityCache;
|
|
|
|
static RegisteredServices()
|
|
{
|
|
_services = new List<Type>();
|
|
_serviceOperations = new List<Type>();
|
|
_arguments = new List<Type>();
|
|
_middleware = new List<Type>();
|
|
_entityCache = new List<Type>();
|
|
}
|
|
|
|
public static ImmutableList<Type> Services => _services.ToImmutableList();
|
|
|
|
public static ImmutableList<Type> ServiceOperations => _serviceOperations.ToImmutableList();
|
|
|
|
public static ImmutableList<Type> Arguments => _arguments.ToImmutableList();
|
|
public static ImmutableList<Type> Middleware => _middleware.ToImmutableList();
|
|
|
|
public static ImmutableList<Type> EntityCache => _entityCache.ToImmutableList();
|
|
|
|
public static void AddApiService(Type type)
|
|
{
|
|
_services.Add(type);
|
|
}
|
|
|
|
public static void AddApi(Type type)
|
|
{
|
|
_serviceOperations.Add(type);
|
|
}
|
|
|
|
public static void AddArgument(Type type)
|
|
{
|
|
_arguments.Add(type);
|
|
}
|
|
|
|
public static void AddMiddleware(Type type)
|
|
{
|
|
_middleware.Add(type);
|
|
}
|
|
|
|
public static void AddEntityCache(Type type)
|
|
{
|
|
_entityCache.Add(type);
|
|
}
|
|
}
|
|
}
|