Timeline for Is Moving Entity Framework objects over a webservice really the best way?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 2, 2013 at 18:00 | comment | added | razethestray | Ah, of course... I was kind of envisioning the context being sent also, but I doubt that is even serializable (and if it was I can only thing it would be a nightmare!) Sounds like another case for a DTO - if you need the child object on the other side, you won't have it with an EF object. | |
| Aug 2, 2013 at 17:56 | comment | added | Kirk Broadhurst | That's kind of correct, but if you have an object with lazy-loaded child objects and then you 'disconnect' it from its data context (the database), that child object will be null. Once it's been sent to another process using WCF - well, you might as well have saved it onto a floppy disk and viewed it on your old 386. It's not connected to the database anymore thus won't (i.e. can't) load that child object. | |
| Aug 2, 2013 at 17:14 | comment | added | razethestray | @KirkBroadhurst Perhaps my understanding of EF is flawed in this regard then. I know that by default EF uses lazy loading and therefore if you want to look at an object within an EF object it will trigger a database query by the framework. I was assuming that this would persist across the pipe and would result in EF generating SQL from the client. Is this incorrect? | |
| Aug 2, 2013 at 16:07 | comment | added | Kirk Broadhurst | Your first paragraph seems to miss the point. OP isn't talking about querying his database via webservice. | |
| Aug 2, 2013 at 15:17 | history | answered | razethestray | CC BY-SA 3.0 |