using MediatR; using Teamified.Api.Teams.Interfaces; using Teamified.Api.Teams.Models; namespace Teamified.Api.Teams.Commands.ProvisionTeam; public class ProvisionTeamCommand : IRequest { public string DisplayName { get; set; } public string Description { get; set; } } public class ProvisionTeamCommandHandler : IRequestHandler { private readonly ITeamsService _teamsService; public ProvisionTeamCommandHandler(ITeamsService teamsService) { _teamsService = teamsService; } public async Task Handle( ProvisionTeamCommand request, CancellationToken cancellationToken) { var team = new Team { DisplayName = request.DisplayName, Description = request.Description }; var newTeamLocation = await _teamsService.ProvisionTeam(team); return newTeamLocation; } }