![](/img/trans.png)
[英]C# Google Cloud DataStore Query Filter no matching index found
[英]How to Use Google cloud Datastore with C#
我是Google雲數據存儲的新手,正在嘗試訪問“ KIND”並使用C#保存到。 我已經搜索了谷歌雲上可用的文檔,但是沒有找到如何訪問谷歌數據存儲中的數據並保存到。 我能夠進行身份驗證。
有適用於JAVA,NODE.JS,GO和PYTHON的適當文檔,但不適用於.NET。 請幫忙。
是的,您可以完全使用C#訪問Google雲數據存儲。
該示例向您展示了如何: https : //cloud.google.com/dotnet/getting-started/using-cloud-datastore這是代碼的直接鏈接: https : //github.com/GoogleCloudPlatform/getting-started-dotnet /blob/master/aspnet/2-structured-data/Models/DatastoreBookStore.cs
要按種類搜索:
var query = new Query()
{
Limit = pageSize,
Kinds = new[] { new KindExpression() { Name = "Book" } },
};
要創建具有指定種類的密鑰:
public static Key ToKey(this long id)
{
return new Key()
{
Path = new KeyPathElement[]
{
new KeyPathElement() { Kind = "Book", Id = (id == 0 ? (long?)null : id) }
}
};
}
更多文檔即將發布。
我為Google數據存儲區編寫了一個小型.NET ORM: https : //github.com/NoGame/GoogleDatastoreORM
您可能會發現它很有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.