You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed that in some of the scaffolded PageModels in the example code the wrong namespace reference is given.
For example, in the Pages/Instructors/Index.cshtml.cscode snippet, the _context field is of type ContosoUniversity.Data.SchoolContext, but the namespace that actually contains the SchoolContext type is ContosoUniversity.Models (as specified when first scaffolding the Student model here).
I was going to create a PR myself, but realized it would be better to first discuss what the most appropriate fix would be because there are a few:
Change all the lines of code from private readonly ContosoUniversity.Data.SchoolContext _context; to private readonly ContosoUniversity.Models.SchoolContext _context;
Keep the PageModels as-is, but change the steps in the tutorial to create the data context type in the ContosoUniversity.Data namespace instead
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: d0026f69-7e5d-0d3e-5586-16ecc0656ff0
Version Independent ID: 3cb264da-2ff1-1256-572f-aa4ebca6e255
@RyanLilla I think the problem stems from parts 1-5 were rewritten for ASP.NET Core 2.1 with the 2.1 SDK, but 6-8 were not updated. The scaffolder changed in 2.2
We're going to update this to 2.2 when it RTMs - at that time we'll get all the code updated.
Noticed that in some of the scaffolded PageModels in the example code the wrong namespace reference is given.
For example, in the
Pages/Instructors/Index.cshtml.cs
code snippet, the_context
field is of typeContosoUniversity.Data.SchoolContext
, but the namespace that actually contains the SchoolContext type is ContosoUniversity.Models (as specified when first scaffolding the Student model here).I was going to create a PR myself, but realized it would be better to first discuss what the most appropriate fix would be because there are a few:
Change all the lines of code from
private readonly ContosoUniversity.
Data.SchoolContext _context;
toprivate readonly ContosoUniversity.
Models.SchoolContext _context;
Keep the PageModels as-is, but change the steps in the tutorial to create the data context type in the ContosoUniversity.Data namespace instead
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: