Sorry I can see now I am not making much sense, I will try explain this a little better. In my app I have an admin screen for TableB, My view is returning my populated TableB object, and my presenter is passing this to my service layer to do the insert/update. My issue is with attaching the TableA parent to my entity, initially I was doing all this mapping in my presenter, but felt this was dirty. So basically I was selecting the existing item for an update, selecting the parent item and attaching to the entity then calling the service to update, which would do validation and pass onto repository to do an update.
The only way I can see to make this easy to work with is to move to a DTO for my TableB entity which would be like: Id TableAId Name RowVersion Then in my service Update method for example, I would load the entity by Id and map across the fields, then use my TableA repository to select by ID and attach to the entity, then calling an update on my entity. Without the DTO I just cannot see a clean way to handle this. I hope I am starting to make some sense here :\. I am not a complete idiot just a little confused atm. Cheers On Sun, Sep 14, 2008 at 11:36 PM, Fabio Maulo <[EMAIL PROTECTED]> wrote: > Hi codemonkey. > I don't understand what you are training to do. > Try to explain the problem you want solve, perhaps the way you are walking > is not the best to walk. > > 2008/9/14 codemonkey <[EMAIL PROTECTED]> >> >> Ok I can see that, but if I am setting the ID will it use that >> instead? If I remove the version column and do what I am doing it all >> works fine. The issue is when the version column is there, I read in >> the doco that the version should never be null as it will be >> transient. >> >> I guess my main thing was to see how others are doing something like I >> am trying to do. >> >> >> Cheers >> >> On Sep 14, 10:23 pm, "Fabio Maulo" <[EMAIL PROTECTED]> wrote: >> > You are using "native" as generator but you are assigning the Id (take >> > care >> > with it), you are using unsaved-value=null for version so... if the >> > version >> > is null the entity is transient.Bye. >> > Fabio Maulo >> > > > > -- > Fabio Maulo > > > > -- Stefan Sedich Developer Microsoft Certified Professional (MCP) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
