Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在SQL中为实体框架6的JSON列创建表达式_Json_Entity Framework 6_Expression - Fatal编程技术网

在SQL中为实体框架6的JSON列创建表达式

在SQL中为实体框架6的JSON列创建表达式,json,entity-framework-6,expression,Json,Entity Framework 6,Expression,在使用Entity Framework 6的.NET Framework应用程序中,我想编写一个SQL查询lambda表达式,如下所示: var result = DbContext.Register .Where(r => r.Metadata.JsonValue("$.CONTRACT") == 123456) .ToList(); 我想截取表达式并编写如下SQL命令: public class DbSetInterceptor : ExpressionVisitor

在使用Entity Framework 6的.NET Framework应用程序中,我想编写一个SQL查询lambda表达式,如下所示:

var result = DbContext.Register
    .Where(r => r.Metadata.JsonValue("$.CONTRACT") == 123456)
    .ToList();
我想截取表达式并编写如下SQL命令:

public class DbSetInterceptor : ExpressionVisitor
{
    protected override Expression VisitBinary(BinaryExpression node)
    {
        BinaryExpression expression;

        //WRITE EXPRESSION FOR "JSON_VALUE(Metadata, '$.CONTRACT') = 123456"
        //expression = Expression.MakeBinary(...);

        return base.VisitBinary(expression);
    }
}
如何编写一个表达式来翻译JSON\u值命令