示例#1
0
        public void FindRoots_Parameter()
        {
            var company = RepositoryTool.FindOneByCode <Company>(CompanyCode);

            var depts = RepositoryTool.FindRoots <Department>(0, 0, null, new NHParameter("Company", company));

            depts.Count.Should().Be(1);
        }
示例#2
0
        public void FindRoots_Expression()
        {
            var company = RepositoryTool.FindOneByCode <Company>(CompanyCode);

            var depts = RepositoryTool.FindRoots <Department>(d => d.Company == company);

            depts.Count.Should().Be(1);

            depts = RepositoryTool.FindRoots <Department>(0, 0, d => d.Company == company);
            depts.Count.Should().Be(1);
        }