bugthesystem / FireSharp

An asynchronous cross-platform .Net library for Firebase
The Unlicense
698 stars 147 forks source link

Vb.net responses #40

Closed AlbertAssaad closed 8 years ago

AlbertAssaad commented 8 years ago

Hello trying to read from firebase via vb.net ("writing is doing fine") Class requests.vb:

Public Class Requests
    Private _id As String
    Private _name As String
    Public Property Name As String
       Get
            Return _name
        End Get
        Set(value As String)
            _name = value
        End Set
    End Property
    Public Property id As String
        Get
            Return _id
        End Get
        Set(value As String)
            _id = value
        End Set
    End Property
  End Class

Data on Firebase:

Requests  
 -KHPHazxNKUOFWG4bkrh
 Name: 
"Albert"
 id: 
"9e8436045511e793"

Vb.net request:

firebaseclient = New FireSharp.FirebaseClient(conf)

        Dim res As New Requests

        response = Await firebaseclient.GetAsync("Requests")
        res = response.ResultAs(Of Requests)()
        MsgBox(res.Name)

My problem that res object is never filled with the data, another issue how can I get a list of requests in my code (if I have several values under requests on the server")?

fernandoot commented 8 years ago
   firebaseclient = New FireSharp.FirebaseClient(conf)
   Dim res As New Requests
   Dim response = Await firebaseclient.GetAsync("Requests")
   Dim res = response.ResultAs(Of Dictionary(Of String, Requests))
   MsgBox(res.First().Name)
AlbertAssaad commented 8 years ago

This is what I did, Thanks a lot