Skip to content

Instantly share code, notes, and snippets.

@guntidheerajkumar
Created November 22, 2016 09:59
Show Gist options
  • Save guntidheerajkumar/ab2a7d795723dc3e3bd68c93bde0895e to your computer and use it in GitHub Desktop.
Save guntidheerajkumar/ab2a7d795723dc3e3bd68c93bde0895e to your computer and use it in GitHub Desktop.
public async Task Initialize()
{
if (client?.SyncContext?.IsInitialized ?? false)
{
return;
}
var azureUrl = "http://<<AppName>>.azurewebsites.net";
client = new MobileServiceClient(azureUrl);
var path = "employee.db";
path = Path.Combine(MobileServiceClient.DefaultDatabasePath, path);
var store = new MobileServiceSQLiteStore(path);
store.DefineTable<EmployeeInfo>();
await client.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler());
table = client.GetSyncTable<EmployeeInfo>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment