Internet Programming

profilelambertminko
UpdatedTripLog1.pdf

Update the Trips Log app In this project, you’ll update the Trips Log app from Lecture 5. With this update, the application uses EF core to store and retrieve data from database tables. It also uses multiple related entities, rather than a single Trip entity.

The Trips page

The Add Trip page

The Activities page

The Manage page

Specifications  Use Entity Framework (EF) Code First and migrations to create a new database named TripLog that

maps to the following entities.

o There should be a Trip entity.

o There should be a Destination entity that has a one-to-many relationship with the Trip entity. That is, a trip can only have one destination, but a destination can be associated with more than one trip. The foreign key in the Trip entity should be configured so that attempting to delete a destination that’s associated with a trip throws an error.

o There should be an Accommodation entity that has a one-to-many relationship with the Trip entity. That is, a trip can only have one accommodation, but an accommodation can be associated with more than one trip. The foreign key in the Trip entity should be configured so that when you delete an accommodation that’s associated with a trip, the app sets the accommodation for that trip to null.

o There should be an Activity entity that has a many-to-many relationship with the Trip entity. That is, a trip can have more than one activity, and an activity can be associated with more than one trip.

 Make sure to encapsulate your EF Core code in its own data layer.

 The Trips page is the main page, and it retrieves trips from database and display them in a grid. Add a delete button to each trip to allow users to delete a trip.

 New Trip page is the first page for adding a new trip. Update it so that it allows users to select the destination and accommodation from drop-downs, rather than entering them in text boxes.

 The second step of adding a new trip is to add activities. Update the Activities page so the user can select one or more activities from a <select> element that allows multiple selections.

 Add a Manager page that provides a way for users to add and delete destinations, accommodations, and activities to and from database.

 Provide a way to access the Manager page from the Add Trip page.