Browse Source

Merge pull request #1911 from onurkanbakirci/dev-mediator

MediatR error solved.
pull/1914/head
Tarun Jain 2 years ago
committed by GitHub
parent
commit
37474024fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 22 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. +1
    -0
      src/Services/Ordering/Ordering.API/GlobalUsings.cs
  5. +2
    -2
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  6. +2
    -2
      src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj
  7. +1
    -0
      src/Services/Ordering/Ordering.Infrastructure/GlobalUsings.cs
  8. +2
    -2
      src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj
  9. +10
    -0
      src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs
  10. +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;


+ 1
- 0
src/Services/Ordering/Ordering.API/GlobalUsings.cs 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;

+ 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>


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

+ 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