Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.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# 移动服务:如何处理查询字符串过长的情况?_C#_Azure_Azure Mobile Services_Offline Mode - Fatal编程技术网

C# 移动服务:如何处理查询字符串过长的情况?

C# 移动服务:如何处理查询字符串过长的情况?,c#,azure,azure-mobile-services,offline-mode,C#,Azure,Azure Mobile Services,Offline Mode,借助Azure Mobile Services离线支持,我将发出如下PullAsync查询: // This list contains 53 emails var deviceContactEmails = new List<string> { "derek@gmail.com", "sarah@gmail.com", ... }; var query = _userTable.Where(x => deviceContactEmails.Contains(x.Email))

借助Azure Mobile Services离线支持,我将发出如下PullAsync查询:

// This list contains 53 emails
var deviceContactEmails = new List<string> { "derek@gmail.com", "sarah@gmail.com", ... };
var query = _userTable.Where(x => deviceContactEmails.Contains(x.Email));
await _userTable.PullAsync(query);
问题是,如果deviceContactEmails太长,服务会抱怨查询字符串的长度。尝试过滤URL中的这么多项是一个问题,因此我需要通过使用JSON或其他方式传递请求体中的项来进行过滤


因此,我想问题是:如何正确地使用具有脱机支持的移动服务SDK设置此设置,以避免超出URL编码请求中查询字符串长度的限制?

看起来我需要创建一个自定义API来发送电子邮件列表作为请求的主体。我会更新这个答案,如果我解决了,我会接受

在此上下文中,运算符中的
限制相当大。您能否澄清当
deviceContractEmails
失败时,其中有多少元素?只有53个。这个错误确实提到我可以增加查询字符串长度,但是这样做会带来安全风险。代码中的“查询字符串长度”在哪里起作用?这是什么代码?客户端代码?服务器端代码?我对“查询字符串长度”在这里的相关性感到困惑;您的
deviceContactEmails
似乎是在服务器端构造的,在这种情况下,该错误将是一种误导。这是使用IMobileServiceSyncTable从Azure中提取数据的客户端代码。deviceContactEmails是在客户端构建的列表。问题是LINQ查询被转换为URL编码的GET,这导致查询字符串太长。我现在用更多的信息更新这个问题。
https://rememberwhen.azure-mobile.net/tables/User?$filter=((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net')%20or%20(email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))%20or%20(email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))%20or%20(email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))&$skip=0&$top=50&__includeDeleted=true&__systemproperties=__createdAt%2C__version