I am building an application based on Ria Services.
Amongst the default methods that were built by the Visual Studio Wizard, I can see the ones that should insert and persist new data.
For example:
public void InsertCustomer(Customer customer)
{
if ((customer.EntityState != EntityState.Detached))
{
this.ObjectContext.ObjectStateManager.ChangeObjectState(customer, EntityState.Added);
}
else
{
this.ObjectContext.Customers.AddObject(customer);
}
}
However, I don't see any this.ObjectContext.SaveChanges(), which I read should be invoked in order to insert the entity in the data store. ...do I need to modify these functions in order to persist the information?
Thanks in advance, Cheers, Gianluca.