That's ok, i forgot to add information. .... my question continued: my
first reaction is to create a new project specificly for DTO, but
complication is what i'm trying to avoid, so i think it would be
better to make it part of the Services project that handles commands.
My interfaces are there already , soo....?

On Oct 19, 9:43 am, José F. Romaniello <[email protected]>
wrote:
> uh! sorry, I have some misspelled words!
> "with", "some people"
>
> 2009/10/19 José F. Romaniello <[email protected]>
>
>
>
> > I don't know that, because I even don't know why do you need a DTO.
> > DTO is the acronym of "Data Transfer Object", should be simple, you don't
> > want to transfer something whit nhibernate inside.
> > Try in your service; or if you will use NHibernate to fill the DTO, in your
> > DAL.
>
> > Sompeople use AutoMapper to Object-To-Object mapping. but.. It depends.
>
> > 2009/10/19 YankeeImperialistDog <[email protected]>
>
> >> What about this?
> >>http://ayende.com/Blog/archive/2007/12/05/Object--Object-mapping.aspx
>
> >> On Oct 19, 8:57 am, YankeeImperialistDog <[email protected]>
> >> wrote:
> >> > Thanks for the reply,
> >> > Your advise is appreciated and i'm going to agree with you.  My
> >> > question now is what stratagy would you recomend for DTO that
> >> > minimizes coding and can make use of existing entities, but not break
> >> > sepration? I'm really trying to organize, simplify, and standardize my
> >> > projects even if it means creating a mini framework just for DTO, i'll
> >> > do it.
>
> >> > On Oct 17, 7:35 pm, José F. Romaniello <[email protected]> wrote:
>
> >> > > It is not a good place for such logic.A dto should be simpler than
> >> that.
> >> > > Keep nhibernate in your DAL, repositories or dao.
>
> >> > > 2009/10/17 YankeeImperialistDog <[email protected]>
>
> >> > > > I'm creating, or trying to create a DTO for a Person class
> >> > > > ******
> >> > > > namespace KurtStack.Data.Repositories
> >> > > > {
> >> > > >    public static class PersonDTO
> >> > > >    {
> >> > > >        public static object GetPersonDTO()
> >> > > >        {
> >> > > >            var session =
> >> > > > IoC.Container.Resolve<INHibernateSessionProvider>() as ISession;
> >> > > >            var obj = session.CreateCriteria(typeof(Person))
> >> > > >                .CreateAlias("FirstName", "fn")
> >> > > >                .CreateAlias("LastName", "ln");
> >> > > >            return  obj;
> >> > > >        }
> >> > > >    }
> >> > > > }
> >> > > > ***
> >> > > > my problem is getting this to return to my UI via a Command object
> >> > > > with out directly referencing INHibernateSessionProvider. Any ideas
> >> on
> >> > > > how to do this?
>
> >> > > > my command object does not directly reference KurtStack.Data.
>
> >> > > > so to get it to the UI i'd like to do something like this:
> >> > > > GetPersonDTO. ... hrlp
>
> >> > > >   public class NewPersonCommand : ICommand
> >> > > >    {
> >> > > >        private readonly Person person;
>
> >> > > >        public static object GetPersonDTO()
> >> > > >        {
> >> > > >         object obj  = GetpersonDTO();
> >> > > >            return  obj;
> >> > > >        }- Hide quoted text -
>
> >> > > - Show quoted text -- Hide quoted text -
>
> >> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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