I am trying save a new Person to the database. My code compiles just fine but when I run it I get an error at at the .Add().
The error says,
"This EntitySet of Type 'Diavik.DataAccess.Person' does not support the 'Add' operation."
This is a SilverLight application and this file is the App.xaml.cs.
Here is my code:
private void OnGetPerson_Completed(LoadOperation<Person> operation)
{
Person person = operation.Entities.SingleOrDefault();
if (person == null)
{
person = new Person()
{
FirstName = WebContext.Current.User.FirstName,
LastName = WebContext.Current.User.LastName,
IlluminatorLogin = WebContext.Current.User.Name
};
Context.Persons.Add(person);
}
Context.SubmitChanges(submitOp =>
{
// Some Stuff
}, null);
}
Thank you for your help,
Aaron
[Insert]method?