using System.Collections.Immutable; namespace Connected.Configuration { public static class RegisteredServices { private static readonly List _services; private static readonly List _serviceOperations; private static readonly List _arguments; private static readonly List _middleware; private static readonly List _entityCache; static RegisteredServices() { _services = new List(); _serviceOperations = new List(); _arguments = new List(); _middleware = new List(); _entityCache = new List(); } public static ImmutableList Services => _services.ToImmutableList(); public static ImmutableList ServiceOperations => _serviceOperations.ToImmutableList(); public static ImmutableList Arguments => _arguments.ToImmutableList(); public static ImmutableList Middleware => _middleware.ToImmutableList(); public static ImmutableList 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); } } }