Hi all,

I've got an existing database that uses FREETEXTTABLE in a stored
procedure.  I've been using the NHibernate LINQ provider (since we're
switching from LINQ to SQL to NHibernate), and I'd like to know if
there's a way to use FREETEXTTABLE using the LINQ provider.  The
stored procedure takes a few parameters and selects the desired result
set (KEY and RANK columns).  I have a class for these search result
rows.

Currently, I can use the stored procedure using a named SQL query and
get back attached entities:

IQuery query = Session.GetNamedQuery("DoSearch");
query.SetParameter("searchTerm", searchTerm);
IList<SearchResult> results = query.List<SearchResult>();
// results[0].ResultObject is the first underlying object.

We have a few utility methods that use LINQ for some processing
(sorting, pagination, etc) that I'd like to reuse with this stored
procedure.

Ideally, I'd like to do something like:

var doSearch = Session.GetQueryableObjectFromNamedQuery("DoSearch");
doSearch.SetParameter("serachTerm", searchTerm);
IQueryable<SearchResult> resultsQueryable = doSearch.AsQueryable();
IList<SearchResult> results =
myUtilityInstance.SortAndPaginate(resultsQueryable);

Any ideas?  Thanks!

-- 
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