The code that gets generated by Entity Framework 4--mainly the AddTo and Create methods--should I be using those directly? I'm trying to understand the Create method. The CreateDinner method (in NerdDinner) for example is this:
public static Dinner CreateDinner(global::System.Int32 dinnerID, global::System.String title, global::System.DateTime eventDate, global::System.String description, global::System.String hostedBy, global::System.String contactPhone, global::System.String address, global::System.String country, global::System.Double latitude, global::System.Double longitude)
{
Dinner dinner = new Dinner();
dinner.DinnerID = dinnerID;
dinner.Title = title;
dinner.EventDate = eventDate;
dinner.Description = description;
dinner.HostedBy = hostedBy;
dinner.ContactPhone = contactPhone;
dinner.Address = address;
dinner.Country = country;
dinner.Latitude = latitude;
dinner.Longitude = longitude;
return dinner;
}
There is no SubmitChanges() and when I view references, this method isn't being called anywhere. What's the purpose of this method?