Hello Folks ,
As we know that we do not need to write separate method to get an entity Object by Id in Nhibernate . It’s already provided by Nhibernate . Many times we have more than one Id’s and we want to get data object for them …
Well here is a simple probably general method (if you add it to your base repository) for all of your objects (which has “Id” column)
Public IEnumerable Get(IEnumerables ids)
var myCriteria = Session.CreateCriteria().Add(Restrictiona.In(“Id”, ids.ToArray()));
// here you can put your logic ..