Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyWay.Samples.Databases
{
public class SampleAggragateRootRepository : ISampleAggragateRootRepository
public class SampleAggragateRootRepository : ISampleAggragateRootRepository, IAsyncDisposable
{
private readonly IGenericRepository<SampleAggregateRoot> _repository;

Expand All @@ -16,6 +16,11 @@ public Task Add(SampleAggregateRoot aggregateRoot)
return _repository.Add(aggregateRoot);
}

public ValueTask DisposeAsync()
{
return ValueTask.CompletedTask;
}

public Task<SampleAggregateRoot?> Get(Guid id)
{
return _repository.Get(id);
Expand Down
6 changes: 3 additions & 3 deletions source/EasyWay/Internals/Modules/ModuleExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public async Task<CommandResult> Command<TCommand>(TCommand command, Cancellatio
{
CommandResult commandResult;

using (var scope = _serviceProvider.CreateScope())
await using (var scope = _serviceProvider.CreateAsyncScope())
{
var sp = scope.ServiceProvider;

Expand All @@ -37,7 +37,7 @@ public async Task<CommandResult<TOperationResult>> Command<TCommand, TOperationR
{
CommandResult<TOperationResult> commandResult;

using (var scope = _serviceProvider.CreateScope())
await using (var scope = _serviceProvider.CreateAsyncScope())
{
var sp = scope.ServiceProvider;

Expand All @@ -55,7 +55,7 @@ public async Task<QueryResult<TReadModel>> Query<TQuery, TReadModel>(TQuery quer
{
QueryResult<TReadModel> result;

using (var scope = _serviceProvider.CreateScope())
await using (var scope = _serviceProvider.CreateAsyncScope())
{
var sp = scope.ServiceProvider;

Expand Down
Loading