Someone should correct me if I am wrong, but as I understand it, the
trunk provider is the contrib version which has been merged into trunk.
I think that chances are most people asking on this list are using the
contrib version because they haven't updated trunk to the proper version
yet (I know I haven't). I wouldn't plan to use either of them for a
production app but rather figure out how to help Steve Strong get the
new provider written. In the meantime I suppose it doesn't matter which
one you choose to use. I would wrap it in a proxy class so that you can
easily replace it when the time comes:
public class LinqProvider {
ISession _session;
public LinqProvider(ISession session) { _session=session;}
public IQueryable<T> Query<T>() {return _session.Linq<T>(); } // or
.Query
}
This could be a transient IoC provided object you may use, or you could
do new LinqProvider(ISession).Query<Blog>()... every time you want to
use it (though I would go a bit farther and implement an IQueryable
repository class like this:
http://www.codeinsanity.com/2008/08/implementing-repository-and.html
because it makes a lot of sense to me).
Mohamed Meligy wrote:
> I have been using the NHibernate Contrib LINQ provider for a short
> while, then a friend told me that NHibernate trunk itself has another
> LINQ provider that he heard is better.
>
> However, I see all the LINQ related questions here use the one from
> the NHibernate Contrib - ISession.Linq<>() not ISession.Query<>() -
> so, it gets me confused.
>
> The question is:
> *Which NHIbernate LINQ provider is reocmmended to use *-
> ISession.Linq<>() or ISession.Query<>() -*, both short term (now) and
> long term?*
>
> Thank you very much,
> Regards,
>
> --
> Mohamed Meligy
> Information Analyst (.Net Technologies) – Applications Delivery - TDG
> Injazat Data Systems
> P.O. Box: 8230 Abu Dhabi, UAE.
>
> Phone: +971 2 6992700
> Direct: +971 2 4045385
> Mobile: +971 50 2623624, +971 55 2017 621
>
> E-mail: [email protected] <mailto:[email protected]>
> Weblog: http://weblogs.asp.net/meligy
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---