Problems with tutorial v0.8

May 6, 2010 at 1:57 AM

I've gone through the tutorial up to the Membership part. I came across a few problems and have some questions:

  • One problem is already being discussed here:
  • Page 38: If we change the generated partial class, then our changes get overwritten once we change something on the designer. I didn't think it's good practice to change generated code? You could achieve the same thing by just changing the "Entity Container Name" property in the Properties window (F4) of the whole Entity Model to "MusicStoreEntities"
  • Page 40: The parameter passed to the Browse method is (string genre). The document doesn't explain this change? If you look back to Page 16, the method didn't have any parameters and the genre was taken from Request.QueryString. This could confuse people.
  • Page 43: In the StoreManager Index method, the code is "return View(storeDB.Alums);" shouldn't this be "return View(albums);"??? If not, then we've just wasted our time with the LINQ extension (i.e. the albums parameter is not being used).
  • Page 53: Mentions second and third parameters, but there is no third parameter set on Html.EditorFor (only two, and the second parameter is made up of two parts)
  • Page 57: It would be good if the document explained why you can just change the "FormCollection" parameter to "Album" on the Create method. I didn't fully understand this.
  • Page 59: Same deal with the Delete method and changing the FormCollection parameter to a string

Hope this helps.


May 11, 2010 at 6:32 AM

Thanks for the feedback, @aboreham! Will update the document with fixes and clarifications.

One thing I wanted to mention - generally it is a bad idea to change the logic of the generated EF model since it will be overwritten if you update the model. However, changing a class is a pretty minimal change. If you regenerated your model and your app broke because you forgot to set or change the class name, it would be immediately obvious what you needed to do next. We also showed the rename to illustrate that the EF model is just a CLR class, which is reassuring.