Exemple #1
0
        public void SubWhereWithAndSpec()
        {
            var byProductId  = new ProductSpec(1);
            var byName       = new ProductNameSpec("rest");
            var productQuery = new Query(nameof(Product)).Where(byProductId.And(byName)).Select("Id", "Name");
            var query        = Compile(productQuery);

            query[EngineCodes.SqlServer].Should().BeEquivalentTo("SELECT [Id], [Name] FROM [Product] WHERE ([Id] = 1 AND [Name] = 'rest')");
        }