Files
odpo/ConsoleApp1/data/PokemonContext.cs
T
2026-11-27 15:09:02 +03:00

22 lines
810 B
C#

using ConsoleApp1.data.model;
using Microsoft.EntityFrameworkCore;
using Type = ConsoleApp1.data.model.Type;
namespace ConsoleApp1.data;
public class PokemonContext : DbContext
{
public DbSet<Type> Types { get; set; }
public DbSet<Stat> Stats { get; set; }
public DbSet<Ability> Abilities { get; set; }
public DbSet<Pokemon> Pokemons { get; set; }
public DbSet<PokemonType> PokemonsTypes { get; set; }
public DbSet<PokemonStat> PokemonsStats { get; set; }
public DbSet<PokemonAbility> PokemonsAbilitys { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseNpgsql("Username=postgres;Password=mysecretpassword;Host=localhost:5432;Database=postgres;");
}
}