Beispiel #1
0
        public void ModifyQuestionToDatabase(QuestionEntry entry, string key)
        {
            Dictionary <string, object> entryValues = entry.ToDictionary();

            Dictionary <string, object> childUpdates = new Dictionary <string, object>();

            childUpdates[key] = entryValues;

            FirebaseDatabase.DefaultInstance.RootReference.Child("preguntas").UpdateChildrenAsync(childUpdates);
        }
Beispiel #2
0
        public string AddQuestionToDatabase(QuestionEntry entry)
        {
            // Create new entry at /user-scores/$userid/$scoreid and at
            // /leaderboard/$scoreid simultaneously
            string key = FirebaseDatabase.DefaultInstance.RootReference.Child("preguntas").Push().Key;
            Dictionary <string, object> entryValues = entry.ToDictionary();

            Dictionary <string, object> childUpdates = new Dictionary <string, object>();

            childUpdates[key] = entryValues;

            FirebaseDatabase.DefaultInstance.RootReference.Child("preguntas").UpdateChildrenAsync(childUpdates);

            return(key);
        }