Exemplo n.º 1
0
        public async Task <IActionResult> Put([FromBody] UpdateScopeDto dto, Guid id)
        {
            var cmd = new UpdateScopeCommand
            {
                Id          = id,
                Description = dto.Description,
                DisplayName = dto.DisplayName,
                ClaimTypes  = dto.ClaimTypes
            };
            var result = await _sagaBus.InvokeAsync <UpdateScopeCommand, MessageResult>(cmd);

            if (result.Succeed)
            {
                return(Created(Url.Action(), null));
            }
            return(BadRequest(result.Message));
        }
Exemplo n.º 2
0
 public static Scope ToScope(this UpdateScopeCommand command)
 {
     return(command.MapTo <UpdateScopeCommand, Scope>());
 }