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); }
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); }