diff --git a/backend/Controllers/MovieController.cs b/backend/Controllers/MovieController.cs index b58c0a8..c1befae 100644 --- a/backend/Controllers/MovieController.cs +++ b/backend/Controllers/MovieController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.OpenApi.Writers; namespace backend.Controllers; @@ -6,24 +7,18 @@ namespace backend.Controllers; [Route("[controller]")] public class MovieController: ControllerBase { + private readonly MovieDbContext _context; private readonly ILogger _logger; - public MovieController(ILogger logger) + public MovieController(ILogger logger, MovieDbContext context) { _logger = logger; + _context = context; } [HttpGet(Name = "GetMovie")] - public IEnumerable Get() + public IEnumerable Get() { - return Enumerable.Range(1, 5).Select(index => new Movie - { - Title = "Title", - Year = "Year", - imdbID = "imdbID", - Type = "Type", - Poster = "Poster" - }) - .ToArray(); + return _context.Movies.ToList(); } } \ No newline at end of file diff --git a/backend/Controllers/WeatherForecastController.cs b/backend/Controllers/WeatherForecastController.cs deleted file mode 100644 index 44d1739..0000000 --- a/backend/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace backend.Controllers; - -[ApiController] -[Route("[controller]")] -public class WeatherForecastController : ControllerBase -{ - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet(Name = "GetWeatherForecast")] - public IEnumerable Get() - { - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }) - .ToArray(); - } -}