Skip to content
Open
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
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -35,7 +35,8 @@
<PackageVersion Include="GoogleReCaptcha.V3" Version="1.3.1" />
<PackageVersion Include="Markdig" Version="1.3.2" />
<PackageVersion Include="MediaInfo.Wrapper.Core" Version="21.9.3" />
<PackageVersion Include="MediatR" Version="14.1.0" />
<PackageVersion Include="Mediator.Abstractions" Version="3.0.2" />
<PackageVersion Include="Mediator.SourceGenerator" Version="3.0.2" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.2.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.2.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/DevBetterWeb.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="Ardalis.SmartEnum" />
<PackageReference Include="Ardalis.Specification" />
<PackageReference Include="CSharpFunctionalExtensions" />
<PackageReference Include="MediatR" />
<PackageReference Include="Mediator.Abstractions" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" />
<PackageReference Include="NimblePros.Vimeo" />
Expand Down
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/Events/AppStartedEvent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using DevBetterWeb.Core.SharedKernel;
using MediatR;
using Mediator;

namespace DevBetterWeb.Core.Events;

Expand Down
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/Interfaces/IHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using DevBetterWeb.Core.Events;
using DevBetterWeb.Core.SharedKernel;
using MediatR;
using Mediator;

namespace DevBetterWeb.Core.Interfaces;

Expand Down
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/SharedKernel/BaseDomainEvent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using MediatR;
using Mediator;

namespace DevBetterWeb.Core.SharedKernel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" />
<PackageReference Include="Markdig" />
<PackageReference Include="MediatR" />
<PackageReference Include="Mediator.Abstractions" />
<PackageReference Include="NimblePros.Vimeo" />
<PackageReference Include="Ardalis.EFCore.Extensions" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Core.SharedKernel;
using MediatR;
using Mediator;

namespace DevBetterWeb.Infrastructure.DomainEvents;

Expand All @@ -17,7 +17,7 @@ public DomainEventHandler(IEnumerable<IHandle<TDomainEvent>> handlers)
_handlers = handlers;
}

public async Task Handle(TDomainEvent notification, CancellationToken cancellationToken)
public async ValueTask Handle(TDomainEvent notification, CancellationToken cancellationToken)
{
foreach (var handler in _handlers)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
using System.Threading.Tasks;
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Core.SharedKernel;
using MediatR;
using Mediator;
using Microsoft.Extensions.Logging;

namespace DevBetterWeb.Infrastructure.DomainEvents;

public class MediatRDomainEventDispatcher : IDomainEventDispatcher
public class MediatorDomainEventDispatcher : IDomainEventDispatcher
{
private readonly IMediator _mediator;
private readonly ILogger<MediatRDomainEventDispatcher> _logger;
private readonly ILogger<MediatorDomainEventDispatcher> _logger;

public MediatRDomainEventDispatcher(IMediator mediator, ILogger<MediatRDomainEventDispatcher> logger)
public MediatorDomainEventDispatcher(IMediator mediator, ILogger<MediatorDomainEventDispatcher> logger)
{
_mediator = mediator;
_logger = logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using DevBetterWeb.Core.Events;
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Infrastructure.DiscordWebooks;
using MediatR;
using Mediator;

namespace DevBetterWeb.Core.Handlers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static IServiceCollection AddInfrastructureServices(this IServiceCollecti
}

// Common Dependencies
services.AddScoped<IDomainEventDispatcher,MediatRDomainEventDispatcher>();
services.AddScoped<IDomainEventDispatcher, MediatorDomainEventDispatcher>();
// services.AddScoped<IDomainEventDispatcher>(sp => sp.GetRequiredService<DomainEventDispatcher>());

services.AddScoped<IMemberRegistrationService, MemberRegistrationService>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using DevBetterWeb.Core.Exceptions;
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Infrastructure.Identity.Data;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using DevBetterWeb.Core.Exceptions;
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Infrastructure.Identity.Data;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using DevBetterWeb.Core.Events;
using DevBetterWeb.Infrastructure.DomainEvents;
using DevBetterWeb.Infrastructure.Identity.Data;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Infrastructure.Identity.Data;
using GoogleReCaptcha.V3.Interface;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Infrastructure.Identity.Data;
using GoogleReCaptcha.V3.Interface;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
Expand Down
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DevBetterWeb.Core.Events;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
Expand Down
3 changes: 2 additions & 1 deletion src/DevBetterWeb.Web/DevBetterWeb.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<PackageReference Include="CSharpFunctionalExtensions" />
<PackageReference Include="Dapper" />
<PackageReference Include="GoogleReCaptcha.V3" />
<PackageReference Include="MediatR" />
<PackageReference Include="Mediator.Abstractions" />
<PackageReference Include="Mediator.SourceGenerator" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Core.Specs;
using DevBetterWeb.Infrastructure.Identity.Data;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
Expand Down
14 changes: 9 additions & 5 deletions src/DevBetterWeb.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@

builder.Services.AddInfrastructureServices(isDevelopment, vimeoToken);

builder.Services.AddMediatR(cfg =>
cfg.RegisterServicesFromAssemblies(
typeof(IAggregateRoot).Assembly,
typeof(AppDbContext).Assembly,
typeof(Program).Assembly));
builder.Services.AddMediator(options =>
{
options.Assemblies =
[
typeof(IAggregateRoot),
typeof(AppDbContext),
typeof(Program)
];
});

builder.Services.AddScoped(typeof(IRepository<>), typeof(EfRepository<>));

Expand Down
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Web/Services/DailyCheckService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using DevBetterWeb.Core.Events;
using DevBetterWeb.Core.Interfaces;
using DevBetterWeb.Core.Specs;
using MediatR;
using Mediator;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;
using DevBetterWeb.Core.Events;
using DevBetterWeb.Core.Interfaces;
using MediatR;
using Mediator;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using DevBetterWeb.Web;
using DevBetterWeb.Web.Areas.Identity;
using DevBetterWeb.Web.Models;
using MediatR;
using Mediator;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.Testing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MediatR" />
<PackageReference Include="Mediator.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
Expand Down
2 changes: 1 addition & 1 deletion tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Mediator;

namespace DevBetterWeb.FunctionalTests;

public class NoOpMediator : IMediator

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'IPublisher.Publish(object, CancellationToken)'. 'NoOpMediator.Publish(object, CancellationToken)' cannot implement 'IPublisher.Publish(object, CancellationToken)' because it does not have the matching return type of 'ValueTask'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'IPublisher.Publish<TNotification>(TNotification, CancellationToken)'. 'NoOpMediator.Publish<TNotification>(TNotification, CancellationToken)' cannot implement 'IPublisher.Publish<TNotification>(TNotification, CancellationToken)' because it does not have the matching return type of 'ValueTask'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'ISender.CreateStream<TResponse>(IStreamCommand<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'ISender.CreateStream<TResponse>(IStreamQuery<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'ISender.Send(object, CancellationToken)'. 'NoOpMediator.Send(object, CancellationToken)' cannot implement 'ISender.Send(object, CancellationToken)' because it does not have the matching return type of 'ValueTask<object?>'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'ISender.Send<TResponse>(IQuery<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'ISender.Send<TResponse>(ICommand<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / build

'NoOpMediator' does not implement interface member 'ISender.Send<TResponse>(IRequest<TResponse>, CancellationToken)'. 'NoOpMediator.Send<TResponse>(IRequest<TResponse>, CancellationToken)' cannot implement 'ISender.Send<TResponse>(IRequest<TResponse>, CancellationToken)' because it does not have the matching return type of 'ValueTask<TResponse>'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'IPublisher.Publish(object, CancellationToken)'. 'NoOpMediator.Publish(object, CancellationToken)' cannot implement 'IPublisher.Publish(object, CancellationToken)' because it does not have the matching return type of 'ValueTask'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'IPublisher.Publish<TNotification>(TNotification, CancellationToken)'. 'NoOpMediator.Publish<TNotification>(TNotification, CancellationToken)' cannot implement 'IPublisher.Publish<TNotification>(TNotification, CancellationToken)' because it does not have the matching return type of 'ValueTask'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'ISender.CreateStream<TResponse>(IStreamCommand<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'ISender.CreateStream<TResponse>(IStreamQuery<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'ISender.Send(object, CancellationToken)'. 'NoOpMediator.Send(object, CancellationToken)' cannot implement 'ISender.Send(object, CancellationToken)' because it does not have the matching return type of 'ValueTask<object?>'.

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'ISender.Send<TResponse>(IQuery<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'ISender.Send<TResponse>(ICommand<TResponse>, CancellationToken)'

Check failure on line 8 in tests/DevBetterWeb.FunctionalTests/NoOpMediator.cs

View workflow job for this annotation

GitHub Actions / CodeQL Analysis

'NoOpMediator' does not implement interface member 'ISender.Send<TResponse>(IRequest<TResponse>, CancellationToken)'. 'NoOpMediator.Send<TResponse>(IRequest<TResponse>, CancellationToken)' cannot implement 'ISender.Send<TResponse>(IRequest<TResponse>, CancellationToken)' because it does not have the matching return type of 'ValueTask<TResponse>'.
{
public IAsyncEnumerable<TResponse> CreateStream<TResponse>(IStreamRequest<TResponse> request, CancellationToken cancellationToken = default)
{
Expand Down
Loading