Esempio n. 1
0
        public async Task <ActionResult <CreateApiKeyResult> > Create()
        {
            try
            {
                var result = await apiKeyService.CreateApiKeyAsync();

                if (result.Succeeded)
                {
                    return(Created(string.Empty, result));
                }
                else
                {
                    return(BadRequest(result.Errors));
                }
            }
            catch (Exception e)
            {
                Log.Error(e, "An error occured while creating a new api key");
                return(StatusCode(500));
            }
        }