You shouldn't send domain-object over the wire especially when they come
from NH.
Instead transform it to "DTO/view-mode" on the client side your service
should transform it.
Note: DataContract = DTO

On Fri, Jun 11, 2010 at 12:21 PM, bearrito <[email protected]>wrote:

> My question is the following:
>
> I am using Nhibernate in a repository pattern.
> I  query my repository to retrieve my objects.
>
> These object  are all decorated with DataContract or DataMember
> attributes in order to be serialized.
>
> I will then pass these objects to a wcf service. The serialization
> takes place and the objects are passed over the wire. On the client
> side the objects are deserialized and cast into a DTO/Model view.
>
> These DTO's are displayed to the user, the user can make changes and
> save the results.
> As expected the process is reversed and the object is sent back over
> the wire.
>
> My confusion is how to save the detached object. When it comes back
> over the wire I assume it is a "new object".
>
> Should I update or save in the same session?
> Create a new session and merge.
>
> For what it is worth I am using this repository pattern :
> http://daniel.wertheim.se/tag/nhibernate/
>
> I think some of my confusion maybe related to session/instance mgmt.
> so don't assume I know what you are talking about when it comes to
> these.
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>


-- 
Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to