added EF dependencies

Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
haraldnilsen 2023-09-15 10:42:46 +02:00
parent f1455d7ee3
commit cc7bb34302
4 changed files with 37 additions and 1 deletions

View file

@ -0,0 +1,29 @@
using Microsoft.AspNetCore.Mvc;
namespace backend.Controllers;
[ApiController]
[Route("[controller]")]
public class MovieController: ControllerBase
{
private readonly ILogger<MovieController> _logger;
public MovieController(ILogger<MovieController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetMovie")]
public IEnumerable<Movie> Get()
{
return Enumerable.Range(1, 5).Select(index => new Movie
{
Title = "Title",
Year = "Year",
imdbID = "imdbID",
Type = "Type",
Poster = "Poster"
})
.ToArray();
}
}

View file

@ -1,3 +1,5 @@
#nullable disable
namespace backend;
public class Movie

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
#nullable disable
namespace backend;

View file

@ -8,6 +8,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.11">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>