Updating from Microsoft.Azure.Mobile.Client to Microsoft.Datasync.Client
I found this post that is very similar to our existing code, except this appears to be a more standard, generic version from an example by Montenegro. For that reason, I'm using the code from the link in this post.
We are attempting to upgrade the code, which is based on Microsoft.Azure.Mobile.Client, to Microsoft.Datasync.Client for our WebJob application.
Because of the differences in the references, translating from one to the other is proving difficult, even after studying https://learn.microsoft.com/en-us/azure/developer/mobile-apps/azure-mobile-apps/howto/client/dotnet#setup-and-prerequisites
What would be immensely helpful is a generic example that translates the code below into a Microsoft.Datasync.Client example. Thank you!
public async Task Initialize()
{
if (Client?.SyncContext?.IsInitialized ?? false)
return;
var appUrl = "https://mymobileapp.azurewebsites.net";
Client = new MobileServiceClient(appUrl);
var path = "mymobileapp.db";
path = Path.Combine(MobileServiceClient.DefaultDatabasePath, path);
var store = new MobileServiceSQLiteStore(path);
store.DefineTable