小编Jam*_*yot的帖子

团队不显示英雄形象

我一直在尝试通过连接器将卡片发送到团队频道。卡片确实出现了,但我尝试发送的任何英雄图像都没有显示。该留言卡游乐场正确显示图像,但它根本没有在球队露面。我对“正常”图像没有任何问题。

这是我通过 webhook 发送的 JSON,但我也尝试了 Twitter - Hero 图像示例卡,但它也不起作用:

{
  "@type": "MessageCard",
  "@context": "http://schema.org/extensions",
  "summary": "Hero card testing",
  "title": null,
  "text": null,
  "themeColor": "19b5fe",
  "sections": [
    {
      "title": null,
      "activityImage": "https://pbs.twimg.com/profile_images/862653089916096512/ljJwcmFp_bigger.jpg",
      "activityTitle": "Hero image card",
      "activitySubtitle": "This is a test",
      "facts": [],
      "text": null,
      "heroImage": {
        "image": "https://pbs.twimg.com/media/DFv74A0XkAEdwQ_.jpg"
      },
      "images": []
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

microsoft-teams

6
推荐指数
2
解决办法
2255
查看次数

LINQ to CosmosDB 中数组的交集

我正在尝试在我的数据库中查找所有项目,这些项目在数组中至少有一个值,该值与我在代码中拥有的数组中的任何值相匹配(两个数组的交集不应为空)。

基本上,我正在努力实现这一目标:

public List<Book> ListBooks(string partitionKey, List<string> categories)
{
    return _client.CreateDocumentQuery<Book>(GetCollectionUri(), new FeedOptions
    {
        PartitionKey = new PartitionKey(partitionKey)
    })
    .Where(b => b.Categories.Any(c => categories.Contains(c))
    .ToList();
}
Run Code Online (Sandbox Code Playgroud)

Book 类看起来像这样:

public class Book
{
    public string id {get;set;}
    public string Title {get;set;}
    public string AuthorName {get;set;}
    public List<string> Categories {get;set;}
}
Run Code Online (Sandbox Code Playgroud)

但是,SDK 会抛出一个异常,指出在执行此代码时不支持 Method 'Any'。这也不起作用:

return _client.CreateDocumentQuery<Book>(GetCollectionUri(), new FeedOptions
{
    PartitionKey = new PartitionKey(partitionKey)
})
.Where(b => categories.Any(c => b.Categories.Contains(c))
.ToList();
Run Code Online (Sandbox Code Playgroud)

以下代码有效,因为只有一个类别可以找到:

public List<Book> ListBooksAsync(string category)
{
    return _client.CreateDocumentQuery<Book>(GetCollectionUri())
    .Where(b => b.Categories.Contains(category)) …
Run Code Online (Sandbox Code Playgroud)

linq azure azure-cosmosdb

4
推荐指数
1
解决办法
967
查看次数

标签 统计

azure ×1

azure-cosmosdb ×1

linq ×1

microsoft-teams ×1