I am not sure if I should post this here or in the webservices forum, but here goes anyway. I am trying to implement webservices between the admin grids and the db server, and I am having a little issue. My basic question is this; is it possible to serialize an entity that has had it's Query set, pass it to a webservice, deserialize it, call load, serialize again, pass it back to the consumer, and deserialize that into an entity? I've tried and I get the "An Entity can only hold 1 record of data" error. Should I be looking at something along these lines instead? I've tried serializing and deserializing bypassing the webservice and I get the same result.
Code:
try
{
ExclusionLists obj = new ExclusionLists();
obj.Query.Where(obj.Query.Id == this.Id);
ExclusionListsProxyStub proxy = new ExclusionListsProxyStub(obj);
string data = Utility.SerializeProxy(proxy);
proxy = (ExclusionListsProxyStub)Utility.DeserializeProxy(data, typeof(ExclusionListsProxyStub));
obj = proxy.entity;
obj.Query.Load();
return obj;
}
catch (Exception)
{
throw;
}