More surprises!
Well I thought I had everything working, then I tried to load a list of Customers and then that blew up on me.
After a few hours of fruitlessness trying to figure out why one collection will load and another won't, I finally tried to remove the one-to-many collection of Orders from the object... and then it works. So either I have more broken in the service layer code, or Silverlight doesn't my objects having collections (or at this point it could perhaps be associations of any kind).
First step I guess is to try another collection with a 1-to-1 mapping. If that works then I just need to find a way to make my collections work. If that doesn't work, then I guess it is back to digging around for more answers.
Update: Well it did break my 1:1 relationships as well... but I know why now, and it seems perfectly obvious why now that I know the cause. Lazy loading! Back to surfing for answers. I can avoid lazily loading 1:1 relationships, but I will probably kill the performance if I get rid of all lazy loading.
Update2: I can't find a stomachable solution online. This is an existing software package I already have, even synchronous WCF services won't work with lazy loading, though from what I've seen online this would be easier to accomplish. But ultimately not worth the effort. Back to WPF and straight communication with my new engine. Maybe the future will hold some WCF/Silverlight applications, but they will need to start out with that objective in mind.
After a few hours of fruitlessness trying to figure out why one collection will load and another won't, I finally tried to remove the one-to-many collection of Orders from the object... and then it works. So either I have more broken in the service layer code, or Silverlight doesn't my objects having collections (or at this point it could perhaps be associations of any kind).
First step I guess is to try another collection with a 1-to-1 mapping. If that works then I just need to find a way to make my collections work. If that doesn't work, then I guess it is back to digging around for more answers.
Update: Well it did break my 1:1 relationships as well... but I know why now, and it seems perfectly obvious why now that I know the cause. Lazy loading! Back to surfing for answers. I can avoid lazily loading 1:1 relationships, but I will probably kill the performance if I get rid of all lazy loading.
Update2: I can't find a stomachable solution online. This is an existing software package I already have, even synchronous WCF services won't work with lazy loading, though from what I've seen online this would be easier to accomplish. But ultimately not worth the effort. Back to WPF and straight communication with my new engine. Maybe the future will hold some WCF/Silverlight applications, but they will need to start out with that objective in mind.
Comments
Post a Comment