public ActionResult <Token> Get(string id) { var comment = _tokenService.GetApiKey(id); comment.Wait(); if (comment == null) { return(NotFound()); } return(comment.Result); }
// 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)); }