LINQ with ActiveRecord?

18 views
Skip to first unread message

Mike Christensen

unread,
Jan 26, 2012, 12:53:45 PM1/26/12
to castle-project-users
Is there a way to query the database through ActiveRecord using a LINQ
query (and still get ActiveRecord models), or is HQL the preferred way
of doing this? Thanks!

Mike

Nicholas Kilian

unread,
Jan 27, 2012, 1:26:03 AM1/27/12
to castle-pro...@googlegroups.com
Depending on your version of AR,
Castle.ActiveRecord.Framework.ActiveRecordLinq.AsQueryable<T> will do the
job for you (or ActiveRecordLinqBase).

There are some issues with it still, especially when used in VB (operator
support is a bit lacking and you're forced to use .Equals). I use it when I
can for simple queries, for more complex ones with multiple criteria I fall
back on Nhibernate.Criterion.

Mike

--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to
castle-project-u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.

Reply all
Reply to author
Forward
0 new messages