Wednesday, 20 September 2017

How get data from table with NHibernate by where?

Your options are:
Personally, I really like the QueryOver API:
var clients = session.QueryOver<Clients>().Where(x => x.Name == "Foobar").List();
If you only need to get an entity by its ID, you can use Get or Load
var client = session.Get<Clients>(5);
If you search for NHibernate tutorials you'll certainly find a lot of information. I've heard good things about the Summer Of NHibernate screencasts, though I personally haven't seen them.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive