Skip to content

jsonMap List 查询未实现 #2188

@256051

Description

@256051

Feature 特性

jsonMap List 查询未实现

// c# code
class Table11
{
    public int Id { get; set; }

    [JsonMap]
    public TableOptions Options { get; set; }
    
    [JsonMap]
    public List<TableOptions> OptionsList { get; set; }
}

class TableOptions
{
    public int Value1 { get; set; }
    public string Value2 { get; set; }
}

   fsql.Select<Table11>().Where(a => a.OptionsList.Any(q => q.Value2.Contains("xx"))).ToList();

简要描述原因

返回错误:
Unhandled exception. System.Exception: FreeSql: Function expression a.OptionsList.Any(q => q.Value2.Contains("xx")) parsing is not implemented.

使用场景

存储List 在db字段已JsonArray 存储,方便快速查询
SQL 语句是

WHERE  (EXISTS (
                SELECT 1 FROM OPENJSON(a.Value2) 
                WITH (Name NVARCHAR(100) '$.Value2') 
                WHERE Name LIKE '%xx%'))

freesql源码全局搜索未查找到 OPENJSON函数!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions