views:

208

answers:

1

Hello Everyone !

i think my whole questions is inside title bar =] but i'll explain little more.

i've got 2 related tables in database ( Customers and Orders ) and wcf service which returns Customer and all related Orders as DTO's like this :

class CustomerDto
{
int ID;
IList< OrderDto > Orders;
}
and :
class OrderDto
{
int ID;
string someString;
}

what is happening:
client asks for customer (customer is returned with orders ), makes some changes (adds/removes orders, changes someString), and sent data back to service.

here i wanted to ask, is it possible to attach modified Customer to database context, or i'll need make changes manually?

Thank You !

+1  A: 

Here's an article with downloadable code sample on using EF and WCF together, including updates. You can also look at RIA services.

Craig Stuntz
hi. thx for reply.jea that approach in link that you gave works when you dont use dto's ( i think objects are returned with objectstatemanager )but when you get dto you dont have any ObjectStateManager attached.
vbobruisk