I am looking for pointers to why the above method would fail.
In my TableServiceContext subclass I have:
public void AddDevice(Device d)
{
d.PartitionKey = "A";
d.RowKey = Guid.NewGuid().ToString();
this.AddObject("Devices", d);
this.SaveChanges();
}
The call to SaveChanges() fails with a very generic message to diagnostics:
An error occurred while processing this request.. Stack: at System.Data.Services.Client.DataServiceContext.SaveResult.HandleBatchResponse()
at System.Data.Services.Client.DataServiceContext.SaveResult.EndRequest()
at System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at WorkerRole1.DeviceServiceContext.AddDevice(Device d) in DeviceServiceContext.cs:line 30
Any ideas what could be amiss?
The Devices table exists. The storage account exists and seems ok.
Many thanks!
After a lot of tracing and head scratching, it turns out that the SaveChanges() method was unhappy about one of the properties in my entity object. The inner exception spoke about “method not implemented”. Fixed but a more precise exception message would have been nice…