示例#1
0
        public async Task <IActionResult> GetSpel([FromRoute] string speltoken)
        {
            var result = await repository.GetSpel(speltoken);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
        public IActionResult Spel()
        {
            Spel spel = iRepository.GetSpel(RouteData.Values["Token"].ToString());

            if (spel != null)
            {
                return(Ok(JsonConvert.SerializeObject(spel)));
            }
            else
            {
                return(NotFound());
            }
        }
 public ActionResult <Spel> GetGame(string gameToken)
 {
     try
     {
         var spel = iRepository.GetSpel(gameToken);
         return(new ObjectResult(new SpelTbvJson(spel)));
     } catch (Exception e)
     {
         return(null);
     }
 }