I have generated the data model in Entity Framework using an existing database with the tables filled out.
I am trying to access the data from a table and populate a datagrid in WPF but keep getting a null reference exception.
The exception is generated here:
pubilc List<item> GetAllItems()
{
using (var context = new DbEntities())
{
if (context.items != null)
return context.items.ToList() //exception generated here
else
return new List<item>();
}
}