public async Task <IActionResult> Post([FromBody] ScopeCreationDto dto) { var cmd = new CreateScopeCommand { ClaimTypes = dto.ClaimTypes, Description = dto.Description, DisplayName = dto.DisplayName, ScopeName = dto.ScopeName }; var result = await _sagaBus.InvokeAsync <CreateScopeCommand, ScopeCreationResult>(cmd); if (result.Succeed) { return(Created(Url.Action(nameof(GetById), new { id = result.Id }), null)); } return(StatusCode(412, result.Message)); }
public static Scope ToScope(this CreateScopeCommand command) { return(command.MapTo <CreateScopeCommand, Scope>()); }