Skip to content

help in getting data back #311

Description

@eduardoagr

I have this class

`
public FirebaseServices(string databaseUrl) {
_firebaseClient = new FirebaseClient(databaseUrl);
}

    public async Task<LocalUser>? GetAsync(string Node, string id) {
        var result = await _firebaseClient
            .Child(Node).Child(id)
            .OnceSingleAsync<LocalUser>();

        if (result == null) {
            return null;
        }

        return result;
    }

    public async Task<IReadOnlyCollection<FirebaseObject<LocalUser>>> GetAllAsync(string Node) {

        var FireUsers = await _firebaseClient
           .Child(Node)
           .OnceAsync<LocalUser>();

        return FireUsers;

    }

    public async Task<FirebaseObject<LocalUser>> CreateAsync(string Node, LocalUser user) {

        var newUser = await _firebaseClient.Child(Node)
        .PostAsync(user);

        return newUser;
    }



    public async Task UpdateAsync(UserData UserToUpdate) {
        await _firebaseClient.Child(UserToUpdate.Key).PutAsync
            (UserToUpdate.Object);
    }

    public async Task DeleteAsync(string path) {
        await _firebaseClient.Child(path).DeleteAsync();
    }
}

}
`

But for some reason the GetAllAsync bring me data, but the GetAsync doesn't

this is my data

{"Key":"-NNpL5Gb1I9O5Usd12ci","Object":{"Email":"a@a.com","Password":"123456","FirstName":"a","LastName":"a","Username":"a","Confirm":null,"DateOfBirth":"2018-05-05T00:00:00","DateOfBirthString":"5/5/2018","DateOfSuscriptionStartString":"1/1/0001","DateOfSuscriptionEndString":"1/1/0001","Id":"DqPTMCpLNfeZuYBfixrIHyxmDZB2","City":"Madrid","HasPaid":false,"IsActive":false,"SuscriptionStartDate":"0001-01-01T00:00:00","SuscriptionEndDate":"0001-01-01T00:00:00","Country":"Espa\u00F1a","PhotoUrl":null,"Age":4}}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions