Пример #1
0
        public ActionResult <Token> Get(string id)
        {
            var comment = _tokenService.GetApiKey(id);

            comment.Wait();
            if (comment == null)
            {
                return(NotFound());
            }

            return(comment.Result);
        }
Пример #2
0
        // GET: odata/Tokens(5)
        public async Task <IHttpActionResult> GetToken([FromODataUri] string key, ODataQueryOptions <Token> queryOptions)
        {
            // validate the query.
            try
            {
                queryOptions.Validate(_validationSettings);
            }
            catch (ODataException ex)
            {
                return(BadRequest(ex.Message));
            }

            var token = await _tokenService.GetApiKey(key);

            return(Ok(token));
        }