I am trying to get a ListView with the names of each item inside the database but all I get back is the full table name. And if it is possible I want to use the same function to get other info like id later. If more information is needed ask me.
This is my code:
calling the function:
var categories = App.Database.GetCategoryByMenuID(1);
listView.ItemsSource = categories;
function:
public List<Categories> GetCategoryByMenuID(int menuID)
{
return db.Table<Categories>().Where(x => x.Menu_ID == menuID).ToList();
}
table:
public class Categories
{
public Categories()
{
}
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int Menu_ID { get; set; }
public string Name { get; set; }
}
thank you in advance,
GetCategoryByMenuID's return trype isList<Categories>and how can it returnfull table name?