I've added a ScheduledTaskAgent
project affiliated with my WP8 project - I added a reference in the WP8 project to the ScheduledTaskAgent
project. In the ScheduledTaskAgent
project's OnInvoke()
code, I want to query a WAMS table that is already defined in the WP8 project. The WAMS code is "greek" to the ScheduledTaskAgent
project. IOW, this is not recognized by it:
protected override void OnInvoke(ScheduledTask task)
{
IMobileServiceTable<WAMS_INVITATIONS> table =
app.MobileService.GetTable<WAMS_INVITATIONS>();
MobileServiceTableQuery<String> query = <bla>;
return await query.ToListAsync();
. . .
}
...which is not at all surprising, because "app" is the other project's App.xaml.cs
class, and WAMS_INVITATIONS
is the class in the other project that defines the table to be queried. So...is it okay for a ScheduledTaskAgent
project to add a reference back to the foreground project that references it, or will this circular reference cause problems? Otherwise, I need to copy over the MobileService
declaration from App.xaml.cs and the table definition class from the foreground project?
I made IMobileServiceTable understandable to the compiler by adding a reference to "Windows Azure Mobile Services Managed Client" to the ScheduledTaskAgent project.