6.1: NoteController Changes
Make Changes in the NoteController.cs
NoteController.cs
In this module, we will be adding code to the skeleton NoteController
we previously made.
Open the
NoteController.cs
fileIn the
Index()
method change the following:CTRL .
to bring in the using statementsThe
Index()
method displays all the notes for the current user. Notice the methods and services that it calls upon.Add the following code in the
Create
methodThe
Create(NoteCreate model)
method makes sure the model is valid, grabs the currentuserId
, calls onCreateNote
, and returns the user back to the index view.
Next, we'll set some breakpoints and look at the database.
Last updated