示例#1
0
        public async Task <ActionResult <CovenantUser> > CreateUser([FromBody] CovenantUserLogin login)
        {
            try
            {
                CovenantUser user = await _context.CreateUser(_userManager, login, _eventhub);

                return(CreatedAtRoute(nameof(GetUser), new { id = user.Id }, user));
            }
            catch (ControllerNotFoundException e)
            {
                return(NotFound(e.Message));
            }
            catch (ControllerBadRequestException e)
            {
                return(BadRequest(e.Message));
            }
            catch (ControllerUnauthorizedException)
            {
                return(new UnauthorizedResult());
            }
        }