generated from admin/template
17 lines
520 B
C#
17 lines
520 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using PokedexApi.Data.Models;
|
|
using Type = PokedexApi.Data.Models.Type;
|
|
|
|
namespace PokedexApi.Data;
|
|
|
|
public class PokemonContext: DbContext
|
|
{
|
|
public DbSet<Type> Types { get; set; }
|
|
public DbSet<Pokemon> Pokemons { get; set; }
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
base.OnConfiguring(optionsBuilder);
|
|
optionsBuilder.UseNpgsql("Username=postgres;Password=123;Host=localhost:5432;Database=postgres");
|
|
}
|
|
} |