Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarity: Ambiguous video makes it appear that model binding fails. #4

Open
kevingates opened this issue May 8, 2019 · 0 comments
Open

Comments

@kevingates
Copy link

kevingates commented May 8, 2019

PROBLEM:

While doing the model binding for the Details page, the Name, Cuisine, and Location data never populate.

URL:

Link to Course ASP.NET Fundamentals, Module 3, Clip 8: "Linking to the Details"

Timestamp:

5:52

Expected:

And now I have my little zoom in icon on the right, and if I click on this, I can see yes, that went to /Restaurants/Detail query string restaurantId=2. So my tag helpers asp-page and asp-route, they decided the best way to pass a restaurant ID to the Detail page is by placing the restaurant ID in the query string.

I expect to see the Name as a header, Id, Location, and Cuisine related to the Id parameter passed in.

Actual (May 08, 2019 at 3:14 pm EDT):

The Id comes in, but the Name, Location, and Cuisine do not. The intellisense doesn't notice anything wrong, and in fact suggests the Location field.

The lack of name and location data is both in my code, in this video, and the next video.

Possible causes:

I believe this is because we create a new Restaurant, but never assign values to the other fields.

Suggested Fix:

Update the videos where you reassign the values.
Or provide a brief voice-over mentioning those fields are not yet bound and will be addressed later in the course.
Your final source code below shows you update this later, so personally I would find this helpful to mention as I spent some time attempting to debug before I discovered the issue: https://github.com/OdeToCode/OdeToFood/blob/master/OdeToFood/OdeToFood/Pages/Restaurants/Detail.cshtml.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant