code_junkie

How can I retrieve latest from database using NHibernate after an update?

Nov 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public IList<WorkOrder> FindBy(string fromDate, string toDate)
  2. {
  3. IQuery query = _currentSession.CreateQuery("from WorkOrder wo where wo.Date >= ? and wo.Date <= ?");
  4. query.SetParameter(0, fromDate);
  5. query.SetParameter(1, toDate);
  6. return query.List<WorkOrder>();
  7. }
  8.  
  9. Session.Update(obj);
  10. Session.Evict(obj);
Add Comment
Please, Sign In to add comment