Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.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
C# ArangoDB.NET客户端:关于查询的各种问题(不同的、LET/DOCUMENT、原始AQL)_C#_.net_Arangodb - Fatal编程技术网

C# ArangoDB.NET客户端:关于查询的各种问题(不同的、LET/DOCUMENT、原始AQL)

C# ArangoDB.NET客户端:关于查询的各种问题(不同的、LET/DOCUMENT、原始AQL),c#,.net,arangodb,C#,.net,Arangodb,1.)是否可以在LINQ中执行不同的查询?就像下面的AQL查询一样 FOR cfg IN test_configuration FOR method IN inspection_method FILTER cfg.inspection_method_id == method._id SORT method.name RETURN DISTINCT method 2.)是否可以执行“让文档=文档(某些._id)”?我尝试了下面的查询,但遇到

1.)是否可以在LINQ中执行不同的查询?就像下面的AQL查询一样

FOR cfg IN test_configuration
    FOR method IN inspection_method
        FILTER cfg.inspection_method_id == method._id
        SORT method.name
        RETURN DISTINCT method
2.)是否可以执行“让文档=文档(某些._id)”?我尝试了下面的查询,但遇到了一个关于文档不受支持的异常

from user in users
  let dept = db.Document<Department>(user.department_id)
  where dept.name == "lingerie"
  select user
我算出了#3。我需要从参数中删除@,但将其保留在查询中(我想我在发布之前尝试过,但我猜是每隔一个组合)

List参数=新列表(){
新的ArangoDB.Client.Data.QueryParameter(){
Name=“P1”,
值=EVT,
},
};
query=Database.CreateStatement(@)
用于测试配置中的cfg
用于检验方法中的方法\u方法
在@P1中筛选cfg.inspection\u method\u id==method.\u id和cfg.test\u event\u id
排序方法.name
返回不同的方法(参数)
.AsEnumerable().AsQueryable();
List<ArangoDB.Client.Data.QueryParameter> parameters = new List<ArangoDB.Client.Data.QueryParameter>() {
    new ArangoDB.Client.Data.QueryParameter() {
        Name = "@P1",
        Value = evts,
    },
};

query = Database.CreateStatement<InspectionMethod>(@"
    FOR cfg IN test_configuration
        FOR method IN inspection_method
            FILTER cfg.inspection_method_id == method._id AND cfg.test_event_id IN @P1
            SORT method.name
            RETURN DISTINCT method", parameters)
            .AsEnumerable().AsQueryable();
==============================
5/11/2017 2:02:54 PM
creating an AQL query:
query: 
FOR cfg IN test_configuration
    FOR method IN inspection_method
        FILTER cfg.inspection_method_id == method._id AND cfg.test_event_id IN @P1
        SORT method.name
        RETURN DISTINCT method
bindVars:
name: @P1 value: ["test_event/7250917"]

parsed query with variables replaced:

FOR cfg IN test_configuration
    FOR method IN inspection_method
        FILTER cfg.inspection_method_id == method._id AND cfg.test_event_id IN @P1
        SORT method.name
        RETURN DISTINCT method
List<ArangoDB.Client.Data.QueryParameter> parameters = new List<ArangoDB.Client.Data.QueryParameter>() {
    new ArangoDB.Client.Data.QueryParameter() {
        Name = "P1",
        Value = evts,
    },
};

query = Database.CreateStatement<InspectionMethod>(@"
    FOR cfg IN test_configuration
        FOR method IN inspection_method
            FILTER cfg.inspection_method_id == method._id AND cfg.test_event_id IN @P1
            SORT method.name
            RETURN DISTINCT method", parameters)
            .AsEnumerable().AsQueryable();