I'm wondering if in c# I should create new instance of Google.Cloud.Datastore.V1.DatastoreDb
every time I want to use it or I can keep one global instance as a singleton?
This is in c# .net core 3 on linux with Assembly Google.Cloud.Datastore.V1, Version=2.1.0.0
using Google.Cloud.Datastore.V1;
void DoStuff()
{
var db = DatastoreDb.Create("my-project")
db.Insert(entity);
}
vs.
using Google.Cloud.Datastore.V1;
static db = DatastoreDb.Create("my-project")
void DoStuff()
{
db.Insert(entity);
}