This question is locked. New answers and comments are not allowed.
Hi all,
I'm working with the sample Azure sample :
http://www.telerik.com/help/windows-phone/radcontrols-cloud-synchronization-gettingstarted-azure.html with WP8 with the last telerik build (2014.1.226.3040). Following the forum i correct two points before execute :
1 - Replace Newtonsoft by the last nugget version : 6.0.0.0.
2 - Add a column : synchronizationid (string) in my azur mobile database.
In the AddPerson.Xaml file i have : await this.newPerson.SynchronizeAsync();
When i add a new person with wifi => the new Person is added in Azure and in my local database : LocalDB => ok
When i add a new person without wifi => error : it's normal because it can't synchronize without connection
Now in my scenario i want to : Add localy a person and Synchronize it after.
Then i replace "await this.newPerson.SynchronizeAsync();" by "await "MainViewModel.Instance.Context.AddAsync(newPerson);"
The person is added in my local database with
synchronizationid = 00000000-0000-0000-0000-000000000000
Id = null
But when i do "await MainViewModel.Instance.Context.SynchronizeAsync();" nothing append in the azure server the Person isn't uploaded even when i do "await MainViewModel.Instance.Context.SynchronizeAsync(SynchronizationOperationFlags.Upload);"
I try the same syntax that http://www.telerik.com/help/windows-phone/radcontrols-cloud-synchronization-synccontext.html
SynchronizationContext<Task> tasksContext = SynchronizationContextPool.GetContextForType<Task>();
Task task = new Task();
task.Name = "Meeting with John";
task.Description = "Meet with John to discuss the sales statistics from the last month.";
task.DueDate = new DateTime(26, 12, 2013);// Registers adds the item to the context. This stores is locally and schedules the item for server creation during the next synchronization routine
await tasksContext.AddAsync(task);// Starts a new synchronization routine which makes sure local and Cloud items of the corresponding type are synchronized
await tasksContext.SynchronizeAsync();
adapted to my Person sample but nothing appened, the object isn't uploaded in azure ??
Question 1 :
how can i upload a Person locally added with AddAsync(newPerson) ?
Question 2 :
how can i upload the list of Person added with AddAsync(newPerson) ?
IQueryable<Person> reso = MainViewModel.Instance.Context.LocalDatabase.Where(p=>p.Id==null);
foreach (var person in reso)
{
??????
}
?????????
For your information i try this to do a delete:
IQueryable<Person> reso = MainViewModel.Instance.Context.LocalDatabase.Where(p => p.Id != null);
foreach (var person in reso)
{
Debug.WriteLine(person.Name);
await MainViewModel.Instance.Context.DeleteAsync(person);
}
It's work great for delete but impossible to upload after AddAsync
Thanks you very much for your help
Best regards Manuel
I'm working with the sample Azure sample :
http://www.telerik.com/help/windows-phone/radcontrols-cloud-synchronization-gettingstarted-azure.html with WP8 with the last telerik build (2014.1.226.3040). Following the forum i correct two points before execute :
1 - Replace Newtonsoft by the last nugget version : 6.0.0.0.
2 - Add a column : synchronizationid (string) in my azur mobile database.
In the AddPerson.Xaml file i have : await this.newPerson.SynchronizeAsync();
When i add a new person with wifi => the new Person is added in Azure and in my local database : LocalDB => ok
When i add a new person without wifi => error : it's normal because it can't synchronize without connection
Now in my scenario i want to : Add localy a person and Synchronize it after.
Then i replace "await this.newPerson.SynchronizeAsync();" by "await "MainViewModel.Instance.Context.AddAsync(newPerson);"
The person is added in my local database with
synchronizationid = 00000000-0000-0000-0000-000000000000
Id = null
But when i do "await MainViewModel.Instance.Context.SynchronizeAsync();" nothing append in the azure server the Person isn't uploaded even when i do "await MainViewModel.Instance.Context.SynchronizeAsync(SynchronizationOperationFlags.Upload);"
I try the same syntax that http://www.telerik.com/help/windows-phone/radcontrols-cloud-synchronization-synccontext.html
SynchronizationContext<Task> tasksContext = SynchronizationContextPool.GetContextForType<Task>();
Task task = new Task();
task.Name = "Meeting with John";
task.Description = "Meet with John to discuss the sales statistics from the last month.";
task.DueDate = new DateTime(26, 12, 2013);// Registers adds the item to the context. This stores is locally and schedules the item for server creation during the next synchronization routine
await tasksContext.AddAsync(task);// Starts a new synchronization routine which makes sure local and Cloud items of the corresponding type are synchronized
await tasksContext.SynchronizeAsync();
adapted to my Person sample but nothing appened, the object isn't uploaded in azure ??
Question 1 :
how can i upload a Person locally added with AddAsync(newPerson) ?
Question 2 :
how can i upload the list of Person added with AddAsync(newPerson) ?
IQueryable<Person> reso = MainViewModel.Instance.Context.LocalDatabase.Where(p=>p.Id==null);
foreach (var person in reso)
{
??????
}
?????????
For your information i try this to do a delete:
IQueryable<Person> reso = MainViewModel.Instance.Context.LocalDatabase.Where(p => p.Id != null);
foreach (var person in reso)
{
Debug.WriteLine(person.Name);
await MainViewModel.Instance.Context.DeleteAsync(person);
}
It's work great for delete but impossible to upload after AddAsync
Thanks you very much for your help
Best regards Manuel