We are taking a surprise trip to the Savannah for a safari to see all sorts of exotic animals. During our time there we want to keep track of all the animals we have seen. For this, we need to create a database, as well as a small console application to help record what we see.
Objectives
Use an ORM to query against a database
Requirements
Explorer Mode
[ ] Create a database called SafariVacation / safari_vacation
[ ] This will have 1 table called SeenAnimals / seen_animals that has the following columns
title: ORM Safari! draft: true
We are taking a surprise trip to the Savannah for a safari to see all sorts of exotic animals. During our time there we want to keep track of all the animals we have seen. For this, we need to create a database, as well as a small console application to help record what we see.
Objectives
Requirements
Explorer Mode
[ ] Create a database called
SafariVacation
/safari_vacation
SeenAnimals
/seen_animals
that has the following columnsId
/id
(int)Species
/species
(string)CountOfTimesSeen
/count_of_times_seen
(int)LocationOfLastSeen
/location_of_last_seen
(string)pgcli
.[ ] Create a small console application, and create the following queries using your languages ORM.
CountOfTimesSeen
andLocationOfLastSeen
for an animalJungle
Desert
.CountOfTimesSeen
and get a total number of animals seenCountOfTimesSeen
oflions
,tigers
andbears
Adventure Mode
LastSeenTime
(Ruby:last_seen_at
), with a type of DateTime. This will require you to add and run a new migration.Epic Mode
.NET Notes
Here are the interesting commands you will need for tonight's assignment
To add Entity Framework to your project:
To create your database:
To create the DbContext
dotnet ef migrations add AddBaordGameTable
dotnet ef database update