I have the following problem, my WCF service is pretty simple, send some entities from an entity framework context, which I have disabled the proxy generation and Lazy loading, but what happens is that when I have an entity which I add a reference entity arises me an exception that tells me that the collection has a fixed size. I guess the problem must be in WCF when serializing / deserealizar entity, but I can not think how to solve the problem.
example:
An Office Product has products and has offices, I get the list of available service offices (from entity framework) and then I create a product, but when assigning an office or:
NewProduct.Oficinas.Add(varOficina);
raises the exception that tells me that the collection has a fixed size, but does not arise from the collection “Office” product of the entity, the entity arising from member Office and “Products”, that the problem arises in the body that comes from WCF service, so I guess there goes the problem. Hopefully someone has the answer because it has brought me a lot of headaches
You can create a new collection passing the result of service in the constructor.
example:
This will solve the problem.