Exemple #1
0
        public async Task <IActionResult> LoginUser([FromBody] LoginRequest login)
        {
            switch (login.UserType)
            {
            case 'C':
                var result = await customersProvider.PostLoginAsync(login);

                if (result.IsSuccess)
                {
                    return(Ok(result));
                }

                return(BadRequest(result));

            case 'O':
                var resultOperator = await operatorProvider.PostLoginAsync(login);

                if (resultOperator.IsSuccess)
                {
                    return(Ok(resultOperator));
                }

                return(BadRequest(resultOperator));

            default:
                return(BadRequest());
            }
        }