Exemplo n.º 1
0
        public void SqlExpressionDirectAccess()
        {
            var builder       = new ExampleBuilderBuilder();
            var sqlExpression = new DommelMapper.SqlExpression <FooParameterPrefix>(builder);

            var expression = sqlExpression.Where(p => p.Bar.Contains("test"));
            var sql        = expression.ToSql(out var dynamicParameters);

            Assert.Equal("where Bar like #p1", sql.Trim());
            Assert.Single(dynamicParameters.ParameterNames);
            Assert.Equal("%test%", dynamicParameters.Get <string>("#p1"));
        }