public async Task <IActionResult> Create([FromBody] OperatorSaveView userBody)
        {
            try
            {
                var user = EntityBuilder.Call <Operator>(userBody);
                await _userSave.Execute(user);

                return(StatusCode(201));
            }
            catch (UniqUserRegisterCpf err)
            {
                return(StatusCode(401, new {
                    Message = err.Message
                }));
            }
        }
示例#2
0
        public async Task <IActionResult> Create([FromBody] OperatorSaveView userBody)
        {
            try
            {
                var user = new Operator()
                {
                    Registration = userBody.Registration,
                    Name         = userBody.Name,
                    Password     = userBody.Password
                };
                await _userSave.Execute(user);

                return(StatusCode(201));
            }
            catch (UniqUserRegisterCpf err)
            {
                return(StatusCode(401, new {
                    Message = err.Message
                }));
            }
        }