-
Notifications
You must be signed in to change notification settings - Fork 1
Pokedex Data
Robyn Stanco edited this page Jun 26, 2022
·
14 revisions
The data project utilizes EntityFrameworkCore as an ORM to convert MS SQL database tables into hard typed entity objects.
This class inherits from DbContext, who's instance represents a session with the POKEDEXDB, allowing you to query the database. This class contains all DbSets, constraints, and entities for the POKEDEXDB. It is referenced via a Repository pattern within Pokedex Repository.
Name | Data Type |
---|---|
Id | Guid |
PokemonId | int |
Nickname | string |
Level | int? |
Sex | int? |
Date | DateTime? |
Location | string |
PokeballId | int |
Pokeball | tlkpPokeball |
Pokemon | tlkpNationalDex |
Name | Data Type |
---|---|
Id | int |
Name | string |
tlkpNationalDexAbility | ICollection of tlkpNationalDex |
tlkpNationalDexHiddenAbility | ICollection of tlkpNationalDex |
Name | Data Type |
---|---|
Id | int |
Name | string |
tlkpNationalDex | ICollection of tlkpNationalDex |
Name | Data Type |
---|---|
Id | int |
Name | string |
Japanese Name | string |
Description | string |
CategoryId | int? |
TypeOneId | int? |
TypeTwoId | int? |
AbilityId | int? |
HiddenAbilityId | int? |
ImageURL | string |
HeightInInches | int |
WeightInPounds | int |
Ability | tlkpAbility |
Category | tlkpCategory |
HiddenAbility | tlkpAbility |
TypeOne | tlkpType |
TypeTwo | tlkpType |
tblMyPokedex | ICollection of tblMyPokedex |
Name | Data Type |
---|---|
Id | int |
Name | string |
ImageURL | string |
tbkMyPokedex | ICollection of tblMyPokedex |
Name | Data Type |
---|---|
Id | int |
Name | string |
tlkpNationalDexTypeOne | ICollection of tlkpNationalDex |
tlkpNationalDexTypeTwo | ICollection of tlkpNationalDex |
EntityFrameworkCore provides developers with a handy command to automatically generate the necessary DBContext and models given parameters.
Scaffold-DbContext "Data Source=(localdb)\\MSSQLLocalDB;initial catalog=POKEDEXDB;integrated security=True;" Microsoft.EntityFrameworkCore.SqlServer -UseDatabaseNames -Tables tlkpAbility, tlkpCategory, tlkpNationalDex, tlkpPokeball, tlkpType, tblMyPokedex -OutputDir Models -ContextDir . -Force
(c) Robyn Stanco