vincentoleary / NewForce__MVC__Intro

NewForce multiday exercise to introduce MVC web apps in C# https://github.com/NewForce-at-Mountwest/bangazon-inc/blob/master/book-2-mvc/chapters/ASPNET_INTRO.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unfinished tasks for Dog App

vincentoleary opened this issue · comments

Go into the Shared folder in the _Layout.cshtml file. Add links for "Walkers" and "Owners" in the navbar. If you finish, try changing the views and the styling to your liking.

Create a model for Dog and implement a DogRepository and DogController that gives users the following functionality:
View a list of all Dogs
Create a new Dog (for now, capture the OwnerId as simple input field)
Edit a Dog
Delete a Dog

https://github.com/NewForce-at-Mountwest/bangazon-inc/blob/master/book-2-mvc/chapters/ADD_AND_UPDATE_DATA_IN_MVC.md

In the DogController update the GET and POST methods for the Edit and Delete actions to make sure that a user can only edit or delete a dog that they own. Example: if a user goes to /dogs/edit/5 or /dogs/delete/5 and they don't own that dog, they should get a 404 NotFound result.

Update the Index method in the walkers controller so that owners only see walkers in their own neighborhood. Hint: Use the OwnerRepository to look up the owner by Id before getting the walkers.

If a user goes to /walkers and is not logged in, they should see the entire list of walkers.