using Hutopy.Application.Users.Commands; using Hutopy.Domain.Interfaces; using Hutopy.Infrastructure.Identity; namespace Hutopy.Web.Endpoints; public class Users : EndpointGroupBase { public override void Map(WebApplication app) { app.MapGroup(this) .MapPost(CreateUser) .MapIdentityApi(); } private static async Task CreateUser(ISender sender, CreateUserCommand command, IUserService userService) { await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password); return await sender.Send(command); } }