Compuskills-Jerusalem / mens-capstone-2020

1 stars 0 forks source link

Edit goal bug #67

Closed nossondsimon closed 4 years ago

nossondsimon commented 4 years ago

While integrating the scaffolded edit tab for goals there were some errors that came up while trying to use the .attach method to the db. To sidestep the problem I used a simple findbyId method to change the dbvalues instead.

Example: in the edit controller I implimented the following code:

var dbValue = db.UserEvents.Find(userEvent.UserEventId);

                dbValue.RevisionID += 1;

and since this is an http post I had to store the UserEventId in the view to allow for the find method above:

@Html.HiddenFor(model => model.UserEventId)