diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IDatabaseExtensions.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IDatabaseExtensions.cs index e299602a..fff09584 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IDatabaseExtensions.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IDatabaseExtensions.cs @@ -72,7 +72,7 @@ public static async Task CreateNamespaceAsync(this IDatabase database /// Gets the definition of the specified resource type /// /// The type of to get the definition of - /// The extended + /// The extended /// A /// The resource definition with the specified name, if any public static Task GetDefinitionAsync(this IDatabase database, CancellationToken cancellationToken = default) @@ -85,7 +85,7 @@ public static async Task CreateNamespaceAsync(this IDatabase database /// /// Gets all s /// - /// The extended + /// The extended /// A collection of objects used to configure the labels to filter the s to list by /// A /// A new used to asynchronously enumerate s @@ -97,7 +97,7 @@ public static IAsyncEnumerable GetDefinitionsAsync(this IDa /// /// Lists s /// - /// The extended + /// The extended /// A collection of objects used to configure the labels to filter the s to list by /// The maximum amount of results that should be returned /// A value used to continue paging resource definitions, in the context of a paging request @@ -112,7 +112,7 @@ public static async Task> ListDefinitionsAsync(t /// Gets the with the specified name, if any /// /// The type of to get - /// The extended + /// The extended /// The name of the to get /// The namespace the to get belongs to, if any /// A @@ -130,7 +130,7 @@ public static async Task> ListDefinitionsAsync(t /// Lists s of the specified type /// /// The type of s to list - /// The extended + /// The extended /// The namespace the s to list belongs to, if any. If not set, lists resources across all namespaces /// A collection of objects used to configure the labels to filter the s to list by /// The maximum amount of results that should be returned @@ -149,7 +149,7 @@ public static async Task> ListResourcesAsync(t /// Streams s of the specified type /// /// The type of s to stream - /// The extended + /// The extended /// The namespace the s to stream belongs to, if any. If not set, streams resources across all namespaces /// A collection of objects used to configure the labels to filter the s to stream by /// A diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IRepositoryExtensions.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IResourceRepositoryExtensions.cs similarity index 82% rename from src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IRepositoryExtensions.cs rename to src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IResourceRepositoryExtensions.cs index 70fa9e12..e46b51cd 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IRepositoryExtensions.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Extensions/IResourceRepositoryExtensions.cs @@ -11,26 +11,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -using Neuroglia.Data.Infrastructure.ResourceOriented; using Neuroglia.Data.Infrastructure.ResourceOriented.Services; namespace Neuroglia.Data.Infrastructure.ResourceOriented; /// -/// Defines extensions for implementations +/// Defines extensions for implementations /// -public static class IRepositoryExtensions +public static class IResourceRepositoryExtensions { /// /// Gets the resource definition with the specified name /// - /// The extended + /// The extended /// The API group the resource definition to get belongs to /// The plural name of the resource definition to get /// A /// The resource definition with the specified name, if any - public static async Task GetDefinitionAsync(this IRepository repository, string group, string plural, CancellationToken cancellationToken = default) + public static async Task GetDefinitionAsync(this IResourceRepository repository, string group, string plural, CancellationToken cancellationToken = default) { if (string.IsNullOrWhiteSpace(plural)) throw new ArgumentNullException(nameof(plural)); var resource = await repository.GetAsync(string.IsNullOrWhiteSpace(group) ? plural : $"{plural}.{group}", cancellationToken: cancellationToken).ConfigureAwait(false); @@ -42,10 +41,10 @@ public static class IRepositoryExtensions /// Gets the definition of the specified resource type /// /// The type of to get the definition of - /// The extended + /// The extended /// A /// The resource definition with the specified name, if any - public static Task GetDefinitionAsync(this IRepository repository, CancellationToken cancellationToken = default) + public static Task GetDefinitionAsync(this IResourceRepository repository, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { var resource = new TResource(); @@ -55,13 +54,13 @@ public static class IRepositoryExtensions /// /// Lists s /// - /// The extended + /// The extended /// A collection of objects used to configure the labels to filter the s to list by /// The maximum amount of results that should be returned /// A value used to continue paging resource definitions, in the context of a paging request /// A /// A new that contains all matching s - public static async Task> ListDefinitionsAsync(this IRepository repository, IEnumerable? labelSelectors = null, ulong? maxResults = null, string? continuationToken = null, CancellationToken cancellationToken = default) + public static async Task> ListDefinitionsAsync(this IResourceRepository repository, IEnumerable? labelSelectors = null, ulong? maxResults = null, string? continuationToken = null, CancellationToken cancellationToken = default) { return await repository.ListAsync(null, labelSelectors, maxResults, continuationToken, cancellationToken).ConfigureAwait(false); } @@ -70,12 +69,12 @@ public static async Task> ListDefinitionsAsync(t /// Adds the specified /// /// The type of to add - /// The extended + /// The extended /// The to add /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The added - public static async Task AddAsync(this IRepository repository, TResource resource, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task AddAsync(this IResourceRepository repository, TResource resource, bool dryRun = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { ArgumentNullException.ThrowIfNull(resource); @@ -86,12 +85,12 @@ public static async Task AddAsync(this IRepository reposit /// /// Adds a new /// - /// The extended + /// The extended /// The name of the to add /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The added - public static async Task AddNamespaceAsync(this IRepository repository, string name, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task AddNamespaceAsync(this IResourceRepository repository, string name, bool dryRun = false, CancellationToken cancellationToken = default) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); return await repository.AddAsync(new(name), dryRun, cancellationToken).ConfigureAwait(false); @@ -101,12 +100,12 @@ public static async Task AddNamespaceAsync(this IRepository repositor /// Gets the with the specified name, if any /// /// The type of to get - /// The extended + /// The extended /// The name of the to get /// The namespace the to get belongs to, if any /// A /// The with the specified name, if any - public static async Task GetAsync(this IRepository repository, string name, string? @namespace = null, CancellationToken cancellationToken = default) + public static async Task GetAsync(this IResourceRepository repository, string name, string? @namespace = null, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); @@ -119,14 +118,14 @@ public static async Task AddNamespaceAsync(this IRepository repositor /// Lists s of the specified type /// /// The type of s to list - /// The extended + /// The extended /// The namespace the s to list belongs to, if any. If not set, lists resources across all namespaces /// A collection of objects used to configure the labels to filter the s to list by /// The maximum amount of results that should be returned /// A value used to continue paging resources, in the context of a paging request /// A /// A new that contains all matching s of type specified type - public static async Task> ListAsync(this IRepository repository, string? @namespace = null, IEnumerable? labelSelectors = null, ulong? maxResults = null, string? continuationToken = null, CancellationToken cancellationToken = default) + public static async Task> ListAsync(this IResourceRepository repository, string? @namespace = null, IEnumerable? labelSelectors = null, ulong? maxResults = null, string? continuationToken = null, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { var resource = new TResource(); @@ -138,12 +137,12 @@ public static async Task> ListAsync(this IRepo /// Streams s of the specified type /// /// The type of s to stream - /// The extended + /// The extended /// The namespace the s to stream belongs to, if any. If not set, streams resources across all namespaces /// A collection of objects used to configure the labels to filter the s to stream by /// A /// A new used to stream all matching s of type specified type - public static IAsyncEnumerable GetAllAsync(this IRepository repository, string? @namespace = null, IEnumerable? labelSelectors = null, CancellationToken cancellationToken = default) + public static IAsyncEnumerable GetAllAsync(this IResourceRepository repository, string? @namespace = null, IEnumerable? labelSelectors = null, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { var resource = new TResource(); @@ -155,12 +154,12 @@ public static IAsyncEnumerable GetAllAsync(this IRepositor /// Observes events produced by s of the specified type /// /// The type of s to observe - /// The extended + /// The extended /// The namespace the s to stream belongs to, if any. If not set, observes resources across all namespaces /// A collection of objects used to configure the labels to filter the s to observe by /// A /// A used to observe events produced by s of the specified type - public static async Task> WatchAsync(this IRepository repository, string? @namespace = null, IEnumerable? labelSelectors = null, CancellationToken cancellationToken = default) + public static async Task> WatchAsync(this IResourceRepository repository, string? @namespace = null, IEnumerable? labelSelectors = null, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { var resource = new TResource(); @@ -171,7 +170,7 @@ public static async Task> WatchAsync(this I /// /// Monitors changes to the specified /// - /// The extended + /// The extended /// The API group the to monitor belongs to /// The version of the to monitor /// The plural form of the type of the to monitor @@ -180,7 +179,7 @@ public static async Task> WatchAsync(this I /// A boolean indicating whether or not to leave the open when the is being disposed of /// A /// A new - public static async Task MonitorAsync(this IRepository repository, string group, string version, string plural, string name, string? @namespace = null, bool leaveOpen = false, CancellationToken cancellationToken = default) + public static async Task MonitorAsync(this IResourceRepository repository, string group, string version, string plural, string name, string? @namespace = null, bool leaveOpen = false, CancellationToken cancellationToken = default) { var resource = await repository.GetAsync(group, version, plural, name, @namespace, cancellationToken).ConfigureAwait(false) ?? throw new ProblemDetailsException(ResourceProblemDetails.ResourceNotFound(new ResourceReference(new(group, version, plural), name, @namespace))); var watch = await repository.WatchAsync(group, version, plural, @namespace, cancellationToken: cancellationToken).ConfigureAwait(false); @@ -191,13 +190,13 @@ public static async Task MonitorAsync(this IRepository reposit /// Monitors changes to the specified /// /// The type of the to monitor - /// The extended + /// The extended /// The name of the to monitor /// The namespace the to monitor belongs to, if any /// A boolean indicating whether or not to leave the open when the is being disposed of /// A /// A new - public static async Task> MonitorAsync(this IRepository repository, string name, string? @namespace = null, bool leaveOpen = false, CancellationToken cancellationToken = default) + public static async Task> MonitorAsync(this IResourceRepository repository, string name, string? @namespace = null, bool leaveOpen = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { var resourceReference = new ResourceReference(name, @namespace); @@ -210,14 +209,14 @@ public static async Task> MonitorAsync(th /// Patches the specified /// /// The type of the to patch - /// The extended + /// The extended /// The patch to apply /// The name of the to patch /// The namespace the to patch belongs to, if any /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The replaced - public static async Task PatchAsync(this IRepository repository, Patch patch, string name, string? @namespace = null, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task PatchAsync(this IResourceRepository repository, Patch patch, string name, string? @namespace = null, bool dryRun = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); @@ -231,12 +230,12 @@ public static async Task PatchAsync(this IRepository repos /// Replaces the specified /// /// The type of the to replace - /// The extended + /// The extended /// The state to replace the with /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The replaced - public static async Task ReplaceAsync(this IRepository repository, TResource resource, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task ReplaceAsync(this IResourceRepository repository, TResource resource, bool dryRun = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { ArgumentNullException.ThrowIfNull(resource); @@ -248,14 +247,14 @@ public static async Task ReplaceAsync(this IRepository rep /// Patches the specified 's status /// /// The type of the to patch the status of - /// The extended + /// The extended /// The patch to apply /// The name of the to patch the status of /// The namespace the to patch the status of belongs to, if any /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The replaced - public static async Task PatchStatusAsync(this IRepository repository, Patch patch, string name, string? @namespace = null, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task PatchStatusAsync(this IResourceRepository repository, Patch patch, string name, string? @namespace = null, bool dryRun = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); @@ -269,12 +268,12 @@ public static async Task PatchStatusAsync(this IRepository /// Replaces the specified 's status /// /// The type of the to replace the status with - /// The extended + /// The extended /// The state to replace the the status with /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The replaced - public static async Task ReplaceStatusAsync(this IRepository repository, TResource resource, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task ReplaceStatusAsync(this IResourceRepository repository, TResource resource, bool dryRun = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { ArgumentNullException.ThrowIfNull(resource); @@ -286,13 +285,13 @@ public static async Task ReplaceStatusAsync(this IReposito /// Removes the specified /// /// The type of the to remove - /// The extended + /// The extended /// The name of the to remove /// The namespace the to remove belongs to, if any /// A boolean indicating whether or not to persist the changes induced by the operation /// A /// The removed - public static async Task RemoveAsync(this IRepository repository, string name, string? @namespace = null, bool dryRun = false, CancellationToken cancellationToken = default) + public static async Task RemoveAsync(this IResourceRepository repository, string name, string? @namespace = null, bool dryRun = false, CancellationToken cancellationToken = default) where TResource : class, IResource, new() { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); @@ -304,12 +303,12 @@ public static async Task RemoveAsync(this IRepository repo /// /// Gets all s that apply to the specified resource and operation /// - /// The to query + /// The to query /// The operation for which to retrieve matching s /// An object used to reference the resource to get s for /// A /// A new containing all matching s - public static IAsyncEnumerable GetMutatingWebhooksFor(this IRepository resources, Operation operation, IResourceReference resource, CancellationToken cancellationToken = default) + public static IAsyncEnumerable GetMutatingWebhooksFor(this IResourceRepository resources, Operation operation, IResourceReference resource, CancellationToken cancellationToken = default) { return resources .GetAllAsync(cancellationToken: cancellationToken) @@ -319,12 +318,12 @@ public static IAsyncEnumerable GetMutatingWebhooksFor(this IRep /// /// Gets all s that apply to the specified resource and operation /// - /// The to query + /// The to query /// The operation for which to retrieve matching s /// An object used to reference the resource to get s for /// A /// A new containing all matching s - public static IAsyncEnumerable GetValidatingWebhooksFor(this IRepository resources, Operation operation, IResourceReference resource, CancellationToken cancellationToken = default) + public static IAsyncEnumerable GetValidatingWebhooksFor(this IResourceRepository resources, Operation operation, IResourceReference resource, CancellationToken cancellationToken = default) { return resources .GetAllAsync(cancellationToken: cancellationToken) diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Services/IRepository.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Services/IResourceRepository.cs similarity index 99% rename from src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Services/IRepository.cs rename to src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Services/IResourceRepository.cs index 7e6b43bd..2677775a 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Services/IRepository.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Abstractions/Services/IResourceRepository.cs @@ -16,8 +16,8 @@ namespace Neuroglia.Data.Infrastructure.ResourceOriented.Services; /// /// Defines the fundamentals of a service used to store and manage s /// -public interface IRepository -: IDisposable, IAsyncDisposable +public interface IResourceRepository + : IDisposable, IAsyncDisposable { /// diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/AdmissionControl.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/AdmissionControl.cs index cde5ddec..03e1a16b 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/AdmissionControl.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/AdmissionControl.cs @@ -68,7 +68,7 @@ protected virtual async Task MutateAsync(AdmissionRevie try { - mutators.AddRange(await this.ServiceProvider.GetRequiredService() + mutators.AddRange(await this.ServiceProvider.GetRequiredService() .GetMutatingWebhooksFor(request.Operation, request.Resource, cancellationToken) .Select(wh => ActivatorUtilities.CreateInstance(this.ServiceProvider, wh)) .ToListAsync(cancellationToken).ConfigureAwait(false)); @@ -106,7 +106,7 @@ protected virtual async Task ValidateAsync(AdmissionRev var validators = this.ServiceProvider.GetServices().Where(m => m.AppliesTo(request)).ToList(); try { - validators.AddRange(await this.ServiceProvider.GetRequiredService() + validators.AddRange(await this.ServiceProvider.GetRequiredService() .GetMutatingWebhooksFor(request.Operation, request.Resource, cancellationToken) .Select(wh => ActivatorUtilities.CreateInstance(this.ServiceProvider, wh)) .ToListAsync(cancellationToken)); diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/DefaultResourceValidator.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/DefaultResourceValidator.cs index e78be515..fc53009a 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/DefaultResourceValidator.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/DefaultResourceValidator.cs @@ -25,7 +25,7 @@ namespace Neuroglia.Data.Infrastructure.ResourceOriented.Services; /// /// The service used to serialize/deserialize objects to/from JSON /// The service used to manage the application's s -public class DefaultResourceValidator(IJsonSerializer jsonSerializer, IRepository repository) +public class DefaultResourceValidator(IJsonSerializer jsonSerializer, IResourceRepository repository) : IResourceMutator { @@ -37,7 +37,7 @@ public class DefaultResourceValidator(IJsonSerializer jsonSerializer, IRepositor /// /// Gets the service used to manage the application's s /// - protected IRepository Repository { get; } = repository; + protected IResourceRepository Repository { get; } = repository; /// public bool AppliesTo(Operation operation, string group, string version, string plural, string? @namespace = null) => operation == Operation.Create; diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceController.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceController.cs index dd018f88..e980a21c 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceController.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceController.cs @@ -37,7 +37,7 @@ public class ResourceController /// The service used to create s /// The service used to access the current /// The service used to manage s - public ResourceController(ILoggerFactory loggerFactory, IOptions> controllerOptions, IRepository repository) + public ResourceController(ILoggerFactory loggerFactory, IOptions> controllerOptions, IResourceRepository repository) { this.Logger = loggerFactory.CreateLogger(this.GetType()); this.Options = controllerOptions.Value; @@ -57,7 +57,7 @@ public ResourceController(ILoggerFactory loggerFactory, IOptions /// Gets the service used to manage s /// - protected IRepository Repository { get; } + protected IResourceRepository Repository { get; } /// /// Gets the service used to watch changes on s to control diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/Repository.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceRepository.cs similarity index 96% rename from src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/Repository.cs rename to src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceRepository.cs index 64e01422..8066dc3e 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/Repository.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented/Services/ResourceRepository.cs @@ -18,16 +18,16 @@ namespace Neuroglia.Data.Infrastructure.ResourceOriented.Services; /// -/// Represents the default implementation of the interface +/// Represents the default implementation of the interface /// -public class Repository - : IRepository +public class ResourceRepository + : IResourceRepository { private bool _disposed; /// - /// Initializes a new + /// Initializes a new /// /// The service used to create s /// The service used to provide information about users @@ -35,7 +35,7 @@ public class Repository /// The service used to control versioning of admitted resources /// The current resource database /// An containing known s - public Repository(ILoggerFactory loggerFactory, IUserInfoProvider userInfoProvider, IAdmissionControl admissionControl, IVersionControl versionControl, IDatabase database, IEnumerable patchHandlers) + public ResourceRepository(ILoggerFactory loggerFactory, IUserInfoProvider userInfoProvider, IAdmissionControl admissionControl, IVersionControl versionControl, IDatabase database, IEnumerable patchHandlers) { this.Logger = loggerFactory.CreateLogger(this.GetType()); this.UserInfoProvider = userInfoProvider; @@ -247,9 +247,9 @@ public virtual async Task RemoveAsync(string group, string version, s } /// - /// Disposes of the + /// Disposes of the /// - /// A boolean indicating whether or not to dispose of the + /// A boolean indicating whether or not to dispose of the /// A new protected virtual ValueTask DisposeAsync(bool disposing) { @@ -272,9 +272,9 @@ public async ValueTask DisposeAsync() } /// - /// Disposes of the + /// Disposes of the /// - /// A boolean indicating whether or not to dispose of the + /// A boolean indicating whether or not to dispose of the protected virtual void Dispose(bool disposing) { if (!this._disposed) diff --git a/test/Neuroglia.UnitTests/Cases/Data/Infrastructure/ResourceOriented/Databases/RedisDatabaseTests.cs b/test/Neuroglia.UnitTests/Cases/Data/Infrastructure/ResourceOriented/Databases/RedisDatabaseTests.cs index c0fde793..f2956cd3 100644 --- a/test/Neuroglia.UnitTests/Cases/Data/Infrastructure/ResourceOriented/Databases/RedisDatabaseTests.cs +++ b/test/Neuroglia.UnitTests/Cases/Data/Infrastructure/ResourceOriented/Databases/RedisDatabaseTests.cs @@ -34,7 +34,7 @@ static void ConfigureServices(IConfiguration configuration, IServiceCollection s services.AddHostedService(provider => new ContainerBootstrapper(provider.GetRequiredService())); services.AddSingleton(provider => ConnectionMultiplexer.Connect($"localhost:{provider.GetRequiredService().GetMappedPublicPort(RedisContainerBuilder.PublicPort)}")); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); } } diff --git a/test/Neuroglia.UnitTests/Services/TestRepositoryBuilder.cs b/test/Neuroglia.UnitTests/Services/TestRepositoryBuilder.cs index 2fa4a4f6..c0254fae 100644 --- a/test/Neuroglia.UnitTests/Services/TestRepositoryBuilder.cs +++ b/test/Neuroglia.UnitTests/Services/TestRepositoryBuilder.cs @@ -45,7 +45,7 @@ internal TestRepositoryBuilder WithResource(TResource resource) return this; } - internal async Task BuildAsync() + internal async Task BuildAsync() { var configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json", true) @@ -70,7 +70,7 @@ internal async Task BuildAsync() foreach (var hostedService in _serviceProvider.GetServices()) await hostedService.StartAsync(default).ConfigureAwait(false); - var repository = this._serviceProvider.GetRequiredService(); + var repository = this._serviceProvider.GetRequiredService(); foreach (var definition in this._definitions) await repository.AddAsync(definition.ConvertTo()!, false).ConfigureAwait(false);