public static bool UploadServices(dynamic json, string tableName) { try { FirebaseDB firebaseDB = new FirebaseDB(); FirebaseDB firebaseDBTeams = firebaseDB.Node(tableName); FirebaseResponse getResponse = firebaseDBTeams.Get(); if (getResponse.JSONContent == "" || getResponse.JSONContent == "null") { FirebaseResponse putNewBranchResponse = firebaseDBTeams.Put(newBranch); } bool isEmpty = (string.IsNullOrEmpty(json) || string.IsNullOrWhiteSpace(json) || json == "{}" || json == "[]") ? true : false; if (!isEmpty) { FirebaseResponse putResponse = firebaseDBTeams.Put(json); } return(true); } catch (Exception ex) { throw ex; } }
public static bool UploadServices(dynamic json, string tableName) { try { FirebaseDB firebaseDB = new FirebaseDB(); FirebaseDB firebaseDBTeams = firebaseDB.Node(tableName); FirebaseResponse getResponse = firebaseDBTeams.Get(); if (getResponse.JSONContent == "" || getResponse.JSONContent == "null") { FirebaseResponse putNewBranchResponse = firebaseDBTeams.Put(newBranch); } FirebaseResponse putResponse = firebaseDBTeams.Put(json); return(true); } catch (Exception ex) { throw ex; } }