コード例 #1
0
        public async Task <IActionResult> RegisterMechanic([FromBody] RegisterMechanicCredentials registerMechanicCredentials)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var result = await _accountService.RegisterMechanic(registerMechanicCredentials);

            if (!result.Succeeded)
            {
                return(BadRequest(result.Errors));
            }
            return(Ok());
        }
コード例 #2
0
        public async Task <IdentityResult> RegisterMechanic(RegisterMechanicCredentials registerMechanicCredentials)
        {
            var mechanic = _iMapper.Map <RegisterMechanicCredentials, Mechanic>(registerMechanicCredentials);

            return(await AddUser(mechanic, registerMechanicCredentials.Password));
        }