public void RowsCount() { IRowsCounter rc = new NamedQueryRowsCounter("Foo.Count.All"); using (ISession s = OpenSession()) { Assert.AreEqual(totalFoo, rc.GetRowsCount(s)); } }
public void RowsCountUsingParameters() { DetachedNamedQuery q = new DetachedNamedQuery("Foo.Count.Parameters"); q.SetString("p1", "%1_"); IRowsCounter rc = new NamedQueryRowsCounter(q); using (ISession s = OpenSession()) { Assert.AreEqual(5, rc.GetRowsCount(s)); } }