I would avoid that, because my UnitOfWork(s) and Repository are ORM agnostic.
I'm thinking to use AutoMapper to materialize the objects before to output them outside the Data Layer, so I can map an aggregate to itself using a custom AutoMapper profile to don't load the properties I don't want, probably the best way is to send out the domain a DTO, also to the service (in DDD is made so), so don't have an IRepository<Customer> but have an IRepository<CustomerDto> (I don't expose IRepository, only custom Repository). What do you think? The problem is that my customer now is using my package but it has a lot of legacy code that uses directly the ISession, but now it has migrated to my IRepository so I commented all the Fetch/FetchMany/ThenFetch/ThenFetchMany to be compilable but now obviously there's a big issue with performance. On Tue, Aug 14, 2012 at 12:51 PM, Ramon Smits <[email protected]> wrote: > > Can't you put the query in a method and then inherit from the uow handler > which overrides this query method with a NHibernate specific optimization? > > On Mon, Aug 13, 2012 at 9:52 PM, Matteo Migliore < > [email protected]> wrote: > >> Hi! >> >> I wrapped the ISession interface to an IRepository<T> (in a little more >> complex way), now I've the problem to expose the eager loading feature >> so I want to have this: >> IRepository<T> : IEagerLoading<T> >> ... >> >> IEagerLoading<T> : IQueryable<T> >> { >> IEagerLoading<T> Include<TRelated>(Expression<Func<T, TRelated>> >> path); >> } >> >> On the IRepository<T> I want to write customerRepository.Include(x => >> x.Addresses).Include(x => x.MainAddress); >> >> Do you know a simple way to do that? >> >> Thanks, >> Matteo. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/nhusers/-/030pE7I4fScJ. >> 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. >> > > > > -- > Ramon > > -- > 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. > -- 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.
