Initial commit

This commit is contained in:
2026-09-28 01:47:01 +04:00
commit d87f11edcd
70 changed files with 3173 additions and 0 deletions
@@ -0,0 +1,26 @@
using MediatR;
using MemeVault.Application.Common;
using MemeVault.Domain.Aggregates.Collection;
using MemeVault.Domain.Repositories;
namespace MemeVault.Application.Commands.CreateCollection;
public sealed class CreateCollectionCommandHandler : IRequestHandler<CreateCollectionCommand, Guid>
{
private readonly ICollectionRepository _collections;
private readonly IUnitOfWork _uow;
public CreateCollectionCommandHandler(ICollectionRepository collections, IUnitOfWork uow)
{
_collections = collections;
_uow = uow;
}
public async Task<Guid> Handle(CreateCollectionCommand request, CancellationToken cancellationToken)
{
var collection = Collection.Create(request.OwnerTelegramId, request.Name, request.Description);
await _collections.AddAsync(collection, cancellationToken);
await _uow.SaveChangesAsync(cancellationToken);
return collection.Id;
}
}