Merge pull request #1911 from onurkanbakirci/dev-mediator

MediatR error solved.
This commit is contained in:
Tarun Jain 2022-05-13 00:43:32 +05:30 committed by GitHub
commit 37474024fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,5 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Behaviors; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Behaviors;
public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
{ {
private readonly ILogger<LoggingBehavior<TRequest, TResponse>> _logger; private readonly ILogger<LoggingBehavior<TRequest, TResponse>> _logger;
public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger) => _logger = logger; public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger) => _logger = logger;

View File

@ -2,7 +2,7 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
public class TransactionBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> public class TransactionBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
{ {
private readonly ILogger<TransactionBehaviour<TRequest, TResponse>> _logger; private readonly ILogger<TransactionBehaviour<TRequest, TResponse>> _logger;
private readonly OrderingContext _dbContext; private readonly OrderingContext _dbContext;

View File

@ -1,6 +1,6 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Behaviors; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Behaviors;
public class ValidatorBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> public class ValidatorBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
{ {
private readonly ILogger<ValidatorBehavior<TRequest, TResponse>> _logger; private readonly ILogger<ValidatorBehavior<TRequest, TResponse>> _logger;
private readonly IEnumerable<IValidator<TRequest>> _validators; private readonly IEnumerable<IValidator<TRequest>> _validators;

View File

@ -83,3 +83,4 @@ global using System.Runtime.Serialization;
global using System.Threading.Tasks; global using System.Threading.Tasks;
global using System.Threading; global using System.Threading;
global using System; global using System;
global using System.Collections.Generic;

View File

@ -48,8 +48,8 @@
<PackageReference Include="Google.Protobuf" Version="3.15.0" /> <PackageReference Include="Google.Protobuf" Version="3.15.0" />
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.34.0" /> <PackageReference Include="Grpc.AspNetCore.Server" Version="2.34.0" />
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" /> <PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />
<PackageReference Include="MediatR" Version="9.0.0" /> <PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.18.0" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.18.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.18.0" /> <PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.18.0" />
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="2.0.1" /> <PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="2.0.1" />

View File

@ -5,8 +5,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />
<PackageReference Include="MediatR" Version="9.0.0" /> <PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" /> <PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
</ItemGroup> </ItemGroup>

View File

@ -15,3 +15,4 @@ global using System.Linq;
global using System.Threading.Tasks; global using System.Threading.Tasks;
global using System.Threading; global using System.Threading;
global using System; global using System;
global using System.Collections.Generic;

View File

@ -9,8 +9,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MediatR" Version="9.0.0" /> <PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />

View File

@ -118,6 +118,16 @@ public class OrderingContextDesignFactory : IDesignTimeDbContextFactory<Ordering
class NoMediator : IMediator class NoMediator : IMediator
{ {
public IAsyncEnumerable<TResponse> CreateStream<TResponse>(IStreamRequest<TResponse> request, CancellationToken cancellationToken = default)
{
return default(IAsyncEnumerable<TResponse>);
}
public IAsyncEnumerable<object?> CreateStream(object request, CancellationToken cancellationToken = default)
{
return default(IAsyncEnumerable<object?>);
}
public Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default(CancellationToken)) where TNotification : INotification public Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default(CancellationToken)) where TNotification : INotification
{ {
return Task.CompletedTask; return Task.CompletedTask;

View File

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MediatR" Version="9.0.0" /> <PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.0" /> <PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.0" />
<PackageReference Include="Moq" Version="4.15.2" /> <PackageReference Include="Moq" Version="4.15.2" />