Esempio n. 1
0
        public async Task <IActionResult> CheckUsername(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "users/CheckUsername/{username}")] HttpRequestMessage req,
            HttpRequest request, ILogger log, string username)
        {
            if (String.IsNullOrEmpty(username))
            {
                return(new BadRequestObjectResult(_errors.ValuesNotValid));
            }

            var dataResult = await _controller.CheckUsername(username);

            if (!dataResult.Success)
            {
                return(new BadRequestObjectResult(dataResult.Message));
            }

            return(new OkObjectResult(dataResult.Value));
        }