Facebook
From Arek, 6 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 247
  1. using System.Threading.Tasks;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Newtonsoft.Json;
  4. using WikiMovier.Models;
  5. using WikiMovier.Services;
  6.  
  7. namespace WikiMovier.Controllers
  8. {
  9.         public class MovieController : Controller
  10.         {
  11.                 private readonly IMovie _movieService;
  12.  
  13.                 public MovieController(IMovie movieService)
  14.                 {
  15.                         _movieService = movieService;
  16.                 }
  17.  
  18.                 public IActionResult Index(string query)
  19.                 {
  20.                         var json = _movieService.DownlaodApiDataAsync(query);
  21.                         //var movie =  JsonConvert.DeserializeObject<RootObject>(json);
  22.                         //return View(movie);
  23.  
  24.                         return Content(json.ToString());
  25.                 }
  26.     }
  27. }