【发布时间】:2020-06-17 16:40:37
【问题描述】:
我的 cosmos 数据库中有一个名为“用户”的文档,其分区键为“电子邮件”。我正在使用 GetItemLinqQueryable() 函数通过 Azure 函数检索 cosmos 数据。类型 T 是 UserData 类型,如下所示:
public class UserData
{
public string Id { get; set; }
public string Email { get; set; }
public bool isAdmin { get; set; }
}
我的 cosmos db 容器被称为“用户”,并且具有如下架构:
{
"id": "2",
"email": "ckelly@gmail.com",
"isAdmin": false
}
我正在调用 GetItemLinqQueryable,但由于文档属性和 UserData 属性之间的大小写不同,它无法检索值。有没有办法可以在不区分大小写的情况下进行映射?
【问题讨论】:
标签: c# azure-functions azure-cosmosdb