Exemplo n.º 1
0
        public void TestMin()
        {
            DetachedCriteria expected =
                DetachedCriteria.For <Person>()
                .SetProjection(Projections.Min("Age"));

            DetachedCriteria actual =
                DetachedCriteria.For <Person>()
                .SetProjection(LambdaProjection.Min <Person>(p => p.Age));

            AssertCriteriaAreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void TestMinUsingAlias()
        {
            DetachedCriteria expected =
                DetachedCriteria.For <Person>("personAlias")
                .SetProjection(Projections.Min("personAlias.Age"));

            Person           personAlias = null;
            DetachedCriteria actual      =
                DetachedCriteria <Person> .Create(() => personAlias)
                .SetProjection(LambdaProjection.Min(() => personAlias.Age));

            AssertCriteriaAreEqual(expected, actual);
        }