nhibernate, Retrieve the latest row in a table

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-04-25T21:19:19Z Indexed on 2010/04/25 21:23 UTC
Read the original article Hit count: 166

Filed under:
|
|

A user can have many addresses, but I want to retrieve the latest entry for the user.

In sql I would do:

SELECT TOP 1 *
FROM UserAddress
WHERE userID = @userID

How can I create a criteria query with the same logic?

Is there a TOP functionality?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#