I've been encountering this in the examples throughout the book. On page 569 (Chapter 15) and elsewhere we are instructed to call an Add method which (when we build the project) always produces an error because it doesn't exist. Is there a correction available for this (I didn't see anything in errata). Thanks!
Code:
if(_id == -1) // Insert new item
{
myReview = new Review();
myReview.CreateDateTime = DateTime.Now;
myReview.UpdateDateTime = myReview.CreateDateTime;
myEntities.Reviews.Add(myReview);
}
This is the error I receive when I build the project:
Error 1 'System.Data.Objects.ObjectSet<PlanetWroxModel.Rev iew>' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'System.Data.Objects.ObjectSet<PlanetWroxModel.Rev iew>' could be found (are you missing a using directive or an assembly reference?) C:\BegAPSNET\Site\Management\AddEditReviewHandCode d.aspx.cs 60 36 Site