public FirestoreContext(string credentialsJson) { // read firestore credentials dynamic credentialsObject = JsonConvert.DeserializeObject(credentialsJson); if (credentialsObject == null) { throw new ArgumentNullException(nameof(credentialsJson)); } var projectId = credentialsObject.project_id; // create db object Db = new FirestoreDbBuilder { JsonCredentials = credentialsJson, ProjectId = projectId }.Build(); Me = this; }
public static void Init(string credentialsJson) { Me = new FirestoreContext(credentialsJson); }