- Home /
Question by
NiallFish · Apr 08, 2018 at 08:12 PM ·
database handling
Trouble retrieving my classes from friebase database
So I have a simple class that I'm pushing to the database and t looks like this:
I can push but I can't seem to get it back at all. Does anyone here know how?
public class Dog {
public string walked="no";
public string fed = "no";
public string cleaned = "no";
public string slept = "no";
public string lessonDone = "no";
public Dog() { }
public Dog(string walked, string fed, string cleaned, string slept, string lessonDone)
{
this.walked = walked;
this.fed = fed;
this.cleaned = cleaned;
this.slept = slept;
this.lessonDone = lessonDone;
}
//ConstructerfromFirebase
public Dog(IDictionary<string, object> dict)
{
this.walked = dict["walked"].ToString();
this.fed = dict["fed"].ToString();
this.slept = dict["slept"].ToString();
this.cleaned = dict["cleaned"].ToString();
this.lessonDone = dict["lessonDone"].ToString();
}
}
Comment
Why are these strings? They look like they should of been booleans to me. Can you show your firebase api access and how you are pulling/sending?