Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 public static void Init(string credentialsJson)
 {
     Me = new FirestoreContext(credentialsJson);
 }