using Hutopy.Application.Common.Interfaces; using Hutopy.Domain.Entities; namespace Hutopy.Application.TodoLists.Commands.CreateTodoList; public record CreateTodoListCommand : IRequest { public string? Title { get; init; } } public class CreateTodoListCommandHandler( IApplicationDbContext context) : IRequestHandler { public async Task Handle(CreateTodoListCommand request, CancellationToken cancellationToken) { var entity = new TodoList { Title = request.Title }; context.TodoLists.Add(entity); await context.SaveChangesAsync(cancellationToken); return entity.Id; } }