diff --git a/backend/Controllers/MovieController.cs b/backend/Controllers/MovieController.cs new file mode 100644 index 0000000..b58c0a8 --- /dev/null +++ b/backend/Controllers/MovieController.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Mvc; + +namespace backend.Controllers; + +[ApiController] +[Route("[controller]")] +public class MovieController: ControllerBase +{ + private readonly ILogger _logger; + + public MovieController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetMovie")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new Movie + { + Title = "Title", + Year = "Year", + imdbID = "imdbID", + Type = "Type", + Poster = "Poster" + }) + .ToArray(); + } +} \ No newline at end of file diff --git a/backend/Movie.cs b/backend/Models/Movie.cs similarity index 92% rename from backend/Movie.cs rename to backend/Models/Movie.cs index 537e11f..a48508e 100644 --- a/backend/Movie.cs +++ b/backend/Models/Movie.cs @@ -1,3 +1,5 @@ +#nullable disable + namespace backend; public class Movie diff --git a/backend/MovieResponse.cs b/backend/Models/MovieResponse.cs similarity index 84% rename from backend/MovieResponse.cs rename to backend/Models/MovieResponse.cs index dd207cc..58e8526 100644 --- a/backend/MovieResponse.cs +++ b/backend/Models/MovieResponse.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +#nullable disable namespace backend; diff --git a/backend/backend.csproj b/backend/backend.csproj index d2f5cb0..2f0ded7 100644 --- a/backend/backend.csproj +++ b/backend/backend.csproj @@ -8,6 +8,11 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + +