Browse Source

MediatR error solved.

pull/1908/head
Onurkan Bakırcı 2 years ago
committed by GitHub
parent
commit
184a54304e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 10 deletions
  1. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs
  2. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs
  3. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs
  4. +2
    -2
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  5. +2
    -2
      src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj
  6. +2
    -2
      src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj
  7. +10
    -0
      src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs
  8. +1
    -1
      src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj

+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs 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;


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs 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;


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs 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;


+ 2
- 2
src/Services/Ordering/Ordering.API/Ordering.API.csproj 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" Version="9.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />
<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" />


+ 2
- 2
src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj View File

@ -5,8 +5,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />
<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>


+ 2
- 2
src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj View File

@ -9,8 +9,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="MediatR" Version="10.0.1" />
<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" />


+ 10
- 0
src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs 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;


+ 1
- 1
src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj 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" />


Loading…
Cancel
Save