ParseQuery WhereKey:与.NET相当的MatchesQuery

时间:2016-02-04 09:37:33

标签: c# .net swift parse-platform

有没有办法在.NET中实现以下Swift代码? .NET Parse SDK中似乎缺少该方法 (我有一对多关系将事件对象链接到代码对象)

let query = PFQuery(className: "Events")
let innerQuery = PFQuery(className: "Codes")
innerQuery.whereKey("status", equalTo:"red")
query.whereKey("code",  matchesQuery:innerQuery)

1 个答案:

答案 0 :(得分:0)

似乎有点重命名:

    string[] Bob = { "Bob", "Belcher", "800-123-12345", "13483" };
    string[] James = { "James", "Bond", "555-123-6758", "13484" };
    string[] Clark = { "Clark", "Kent", "111-222-3333", "13485" };

    // create a collection of arrays
    var list = new List<string[]> { Bob, James, Clark };

    string input = Console.ReadLine();
    // User types in Bob

    // Search in the list. Compare user input to [0] element of each string array in the list.
    var userChoice = list.FirstOrDefault(x => x[0] == input);

    if (userChoice != null)
    {
        Console.WriteLine(userChoice[3]);
    }