Skip to content

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

@kevingates

Description

@kevingates

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions