'Trying to update data from firebase, using FirebaseDatabase.net

I have a method to update the file location of particular object, the code for doing this is working fine

public async void UpdateNoteFileLocationAsync(string Id, string NoteFileLocation) {
    await firebaseClient
        .Child(AppConstant.Notes)
        .Child(Id)
        .PatchAsync($"{{ \"FileLocation\" : \"{NoteFileLocation}\" }}");
}

The problem is that I have another method that updates a different item, and is the exact same code.

For some reason this method doesn't work

public async void UpdateNoteBookTitleAsync(string Id, string NotebookName) {
    await firebaseClient
        .Child(AppConstant.Notebooks)
        .Child(Id)
        .PatchAsync($"{{ \"Name\" : \"{NotebookName}\" }}");
}

I get this exception

Firebase.Database.FirebaseException: 'Exception occurred while processing the request.

Url: Couldn't build the url
Request Data: { "Name" : "eduvdvgfvbgfvfsvf" }
Response: '

btw "eduvdvgfvbgfvfsvf" is the new name that I was testing

DB structure

  "Notebooks" : {
    "-MyIHc6fDJtRbQ7GFzip" : {
      "Color" : "#FFFFA500",
      "CreatedDate" : "Wednesday, March 16, 2022",
      "Name" : "edu",
      "UserID" : "wqjizNNCMQdbHoO5bEpd0pYa0Mh2"
    }
  }
}

My question is if the two methods are the same why it doesn't work?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source