This commit is contained in:
328p
2026-11-27 15:09:02 +03:00
parent 56adf7e2bb
commit 56f644e08e
41 changed files with 4240 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
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;");
}
}