Getting a specific data in database and bind it to mypage

29 views Asked by At

I want to get the value where id = 1 from my DB when I execute tapImage_tapped.

async void tapImage_Tapped(object sender, EventArgs e)
{
    await Navigation.PushAsync(new InfoPage() 
    { 
        BindingContext = new values().id_values == 1; 
    });
}

this is the code I have in my DB class. should I use this?

public values GetOneInfo(int id)
{
     lock (locker)
     {
         //return s.Table<Info>().LastOrDefault(t => t.info_id.Equals(id));
         return s.Table<values>().Where(i => i.id_values == id).FirstOrDefault();
     }
}
0

There are 0 answers