简体   繁体   中英

I can't retrieve firebase data using firesharp library in my wpf c# application

I am trying to retrieve data from firebase.

But all attributes of the object in which I am trying to store my data are null. Please help

    using FireSharp.Config;   
    using FireSharp.Interfaces; 
    using FireSharp.Response;


    IFirebaseConfig config = new FirebaseConfig
    {
        AuthSecret= "authsecretexample",
        BasePath= "baspathexample"
    };

    IFirebaseClient client;

'''Function for retrieving data from firebase'''

    //RETRIEVE DATA FROM FIREBASE 
    private async void Button_Click_1(object sender, RoutedEventArgs e)
   {
       client = new FireSharp.FirebaseClient(config);
       if(client != null)
       {

            //usernameTxt is textbox in xaml            
           FirebaseResponse response = await client.GetTaskAsync("Information/" + usernameTxt.Text)
           Users obj = response.ResultAs<Users>(); //obj is object of user class in which i want to store data

           


           //all these MessageBoxes are null
           MessageBox.Show(obj.Name);
           MessageBox.Show(obj.Address);
           MessageBox.Show("Data retrieved");//this message is shown
       }
       else
       {
           MessageBox.Show("could not connect");
       }

       

   }

FirebaseResponse response = await client.GetAsync("Path"); var data = response.get("Path");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM