With the seasons changing to springtime, it is time to start planting our gardens. For this assignment, you will be building an app that allows users to track their gardens. This will us track what plants we have planted, how long ago they were planted and other details.
Objectives
Create a console app that uses an ORM to talk to a database
Working with EF Core
Reenforce SQL basics
Requirements
Create a .NET console app that stores data in a database.
[x] Create a new console application that will store the list of plants the user has planted.
[x] You will be creating a class for your plant.
[x] a Plant has the following properties
[x] Id - primary key
[x] Species - The type of plant
[x] LocatedPlanted - where is the plant plated
[x] PlantedDate - When was the plant planted
[x] LastWateredDate - When was the last time a plant was water
[x] LightNeeded - How much sunlight is needed
[x] WaterNeeded - how much water is needed
[x] Your Plants will be stored in a database called PlantDatabase.
[x] When the console application runs, it should let the user choose one of the following actions:
[x] View All the current plants
this command will show the all the plants in a the list, ordered by LocationPlanted
[x] Plant a new plant
[x] This command will let the user type in the information for a plant and add it to the list
[x] Remove a plant
[x] This will delete a plant by Id
[x] Water
[x] This will update the plant's LastWateredDate to the Current Time. The user will select the plant by Id
[x] View all the plants that have not been watered today
[x] Location summary
[x] This will all the plants that are in given location
[x] quit the program
[x] this will stop the program
Adventure Mode
Add a field to your Plant Model called WateringFrequency. This should be an int that represents how many hours between watering. Add an option for user to see all plants that need water. This should show all the plants where their LastWateredDate is further away than their WateringFrequency
Add a second table, called Gardens. Remove the Location field and create a 1 to many relationship for the Plants to Gardens. Update your menu to reflect as such.
Epic Mode
Go back to your Dinosaur app, remove your list and add a database.
Party Thyme
With the seasons changing to springtime, it is time to start planting our gardens. For this assignment, you will be building an app that allows users to track their gardens. This will us track what plants we have planted, how long ago they were planted and other details.
Objectives
Requirements
Resources
Explorer Mode
.NET
[x] Create a new console application that will store the list of plants the user has planted.
[x] You will be creating a class for your
plant
.[x] a Plant has the following properties
[x] Your Plants will be stored in a database called PlantDatabase.
[x] When the console application runs, it should let the user choose one of the following actions:
Adventure Mode
WateringFrequency
. This should be anint
that represents how many hours between watering. Add an option for user to see all plants that need water. This should show all the plants where theirLastWateredDate
is further away than theirWateringFrequency
Gardens
. Remove theLocation
field and create a 1 to many relationship for the Plants to Gardens. Update your menu to reflect as such.Epic Mode
Go back to your Dinosaur app, remove your list and add a database.
Additional Resources
.NET