Hello,
We have a criteria with a child criteria that looks like this:
DetachedCriteria criteria = CreateCrtieriaForBlogsPosts();
DetachedCriteria subCriteria = DetachedCriteria.For<Comment>("...")
.Add(
Property.ForName("BlogPost.Id"). // This is from
the blog post
EqProperty("BlogPostId"); // This
is from the comment
crtieria.Add(subCriteria);
In the above code, the subcrtieria has a restriction dependent on the
main crtieria's queried object.
For example, only get comments for posts appearing in the main
criteria.
However,
We would like to run a stored procedure to serve the restriction, like
this:
DetachedCriteria subCriteria = DetachedCriteria.For<Comment>("...")
.Add(
Expression.Sql("CommentId in (select CommentId from
(SP_get_blog_comments ({BlogPost.Id}))")
The problem is that this is an SQL string and we need to refer to the
main query in it. However, it is not parsed by NH, and only allows
writing the {alias} alias, which is for the current criteria.
Is this possible?
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.