fix(AuthClientTests): Abhängigkeiten hinzufügen

This commit is contained in:
Developer 02
2025-03-05 14:43:56 +01:00
parent b2a287cab5
commit 6664a1f342
4 changed files with 13 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ public class AuthHub : Hub<IAuthListenHandler>, IAuthSenderHandler
private readonly static string CacheId = Guid.NewGuid().ToString();
public AuthHub(ICryptoFactory cryptoFactory, ILogger logger, IMemoryCache cache)
public AuthHub(ICryptoFactory cryptoFactory, ILogger<AuthHub> logger, IMemoryCache cache)
{
_cFactory = cryptoFactory;
_logger = logger;

View File

@@ -6,12 +6,12 @@ namespace DigitalData.Auth.API.Services;
public static class DIExtensions
{
public static IServiceCollection AddAuthService(this IServiceCollection services, IConfiguration configuration, Action<List<Consumer>>? consumerOptions = null)
public static IServiceCollection AddAuthService(this IServiceCollection services, IConfiguration? configuration = null, Action<List<Consumer>>? consumerOptions = null)
{
List<Consumer> consumers = new();
var consumerKey = $"{nameof(Consumer)}s";
if (configuration.GetSection(consumerKey).Get<IEnumerable<Consumer>>() is IEnumerable<Consumer> consumersFromConfig)
if (configuration?.GetSection(consumerKey).Get<IEnumerable<Consumer>>() is IEnumerable<Consumer> consumersFromConfig)
consumers.AddRange(consumersFromConfig);
consumerOptions?.Invoke(consumers);