public override async Task <MultipleValueResult <TModel> > HandleAsync(GetAllModelsFromEntityQuery <TModel, TEntity, TKey, TContext> request, CancellationToken cancellationToken) { var query = new MultipleValueInquiry <TEntity, TModel>(); var result = await this.repository.RunQueryAsync(query, cancellationToken); return(result); }
public async Task <MultipleValueResult <T> > GetAllAsync <T>(int todoListId, CancellationToken cancellationToken) where T : class { var spec = new Specification <ToDoItem>(x => x.ToDoListId == todoListId); var query = new MultipleValueInquiry <ToDoItem, T>() { SourceSpecification = spec, }; var result = await this.repository.RunQueryAsync(query, cancellationToken); return(result); }
public async Task Handle_MultipleValueInquiry_Test() { using (var scope = this.provider.CreateScope()) { var mediator = scope.ServiceProvider.GetRequiredService <IMediator>(); var request = new MultipleValueInquiry <Source, Target>() { SourceQuery = Array.Empty <Source>().AsQueryable() }; var result = await mediator.HandleAsync(request, default); Assert.NotNull(result); } }