public void UsingParametersTemplate() { var q = new DetachedNamedQuery("Foo.Parameters"); IRowsCounter rc = new NamedQueryRowsCounter("Foo.Count.Parameters", q); q.SetString("p1", "%1_"); SessionFactory.EncloseInTransaction(s => Assert.That(rc.GetRowsCount(s), Is.EqualTo(5))); }
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)); } }
public void RowsCount() { IRowsCounter rc = new NamedQueryRowsCounter("Foo.Count.All"); SessionFactory.EncloseInTransaction(s => Assert.That(rc.GetRowsCount(s), Is.EqualTo(TotalFoo))); }