When I try to retrieve data for a Windows 10 app I am developing with an Azure backend that I have begun to integrate, I receive the strangest error. Please see the code below:
Code in App.xaml.cs
// Setting up a client to retrieve data, using localhost just to try it out
public static MobileServiceClient DigestsTrackerClient = new MobileServiceClient("http://localhost:28451/");
Code on WeekItem.cs
// Method to get data from Mobile Services
public static async void GetWeekItems(List<WeekItem> passer)
{
// Getting a InvalidOperationException down here
IMobileServiceTable<WeekItem> weekTable = App.DigestsTrackerClient.GetTable<WeekItem>();
passer = await weekTable.ToListAsync();
}
More information on the exception:
An exception of type 'System.InvalidOperationException' occurred in
Microsoft.WindowsAzure.Mobile.dll but was not handled in user code
Additional information: No 'id' member found on type 'TechDigest.Model.WeekItem'.
Here is the model for the object I'm attempting to retrieve as well:
public class WeekItem
{
public int WeekID { get; set; }
public string Title { get; set; }
public string ImageURI { get; set; }
}
Any assistance would be greatly appreciated as I basically copied the code from a demo created by an Azure engineer and mine throws this strange exception.