Remove DispatchR and use Mediator

This commit is contained in:
2026-03-29 20:17:32 +02:00
parent 001ec2dfdb
commit 95704c2753
33 changed files with 85 additions and 81 deletions
@@ -1,5 +1,5 @@
using Ardalis.Result;
using DispatchR.Abstractions.Send;
using Mediator;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Musify.Application.Configuration;
@@ -14,9 +14,9 @@ namespace Musify.Application.PlayLists.Handlers
{
public class CreatePlayListCommandHandler(IEventBus eventBus, IDatabase database, IStorageService storageHandler,
ILogger<CreatePlayListCommandHandler> logger, ApplicationStorageConfiguration storageConfiguration, PlayListConfiguration playListConfiguration)
: IRequestHandler<CreatePlayListCommand, Task<Result<PlayListResponse>> >
: ICommandHandler<CreatePlayListCommand, Result<PlayListResponse>>
{
public async Task<Result<PlayListResponse>> Handle(CreatePlayListCommand request, CancellationToken cancellationToken)
public async ValueTask<Result<PlayListResponse>> Handle(CreatePlayListCommand request, CancellationToken cancellationToken)
{
var userExists = await database.Users.AnyAsync(u => u.Id == request.UserId, cancellationToken);
if (!userExists)