views:

213

answers:

1

I have an Ms Access view(query) as following

select * from employee Where EmployeeId=SomeID

Here SomeId is not a field name

If I run this query from MsAccess It prompts me for entering value for SomeId as follows

|---------------------------------------|
| Enter Parameter Value               X |
|---------------------------------------|
| SomeId                                |
| [_________________________________]   |
|                                       |
|                [  OK  ] [ Cancel ]    |
-----------------------------------------

and executes the query based on the same.

Now My question is how can I pass this SomeId using Criteria in Nhibernate.

+2  A: 
session.CreateCriteria(typeof(Employee))
    .Add(Restrictions.Eq("EmployeeId", someId)).List<Employee>();

or

session.Load<Employee>(someId);
Matt Hinze