This question is locked. New answers and comments are not allowed.
Hi
I have an existing aplication using Azure and now I want to try to implement CloudDataAync.
I got so far that when I insert record data gets inserted in the cloud and the local db.
I do this:
await item.SynchronizeAsync();
await Context.SynchronizeAsync();
But when I want to update doing this:
var existingWalletT = App.ViewModel.WalletVM.Wallet3.Where(X => X.Id == existingWallet.Id).Select(x => x).FirstOrDefault();
existingWalletT.Id = null;
existingWalletT.Name = tbName.Text;
existingWalletT.pin = tbPin.Text;
existingWalletT.Icon = ((System.Windows.Media.Imaging.BitmapImage)(walletImmage.Source)).UriSource.ToString();
await existingWalletT.SynchronizeAsync();
I get the error below
What am I doing wrong?
I have manually added the column synchronizationid and populated it with the same value as in the Id column hence my table already contained data when I started to add CloudDataSync
Telerik.Windows.Cloud.SynchronizationException: The id parameter type 'System.Guid' is invalid for looking up items of type 'Wallet'. ---> System.InvalidOperationException: The id parameter type 'System.Guid' is invalid for looking up items of type 'Wallet'.
at Microsoft.WindowsAzure.MobileServices.MobileServiceSerializer.EnsureValidIdForType[T](Object id)
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.<LookupAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.<LookupAsync>d__1e.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Telerik.Windows.Cloud.Azure.AzureCloudService`1.<GetItemAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Telerik.Windows.Cloud.SynchronizationContext`1.<Telerik.Windows.Cloud.ISynchronizationContext.SynchronizeItemAsync>d__2.MoveNext()
--- End of inner exception stack trace ---
at Telerik.Windows.Cloud.SynchronizationContext`1.<Telerik.Windows.Cloud.ISynchronizationContext.SynchronizeItemAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Telerik.Windows.Cloud.Azure.AzureSynchronizableCloudItem.<SynchronizeAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WalletViewModel.<UpdateWalletInTable>d__1b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AddWalletPage.<SaveButton_Click>d__33.MoveNext()}
I have an existing aplication using Azure and now I want to try to implement CloudDataAync.
I got so far that when I insert record data gets inserted in the cloud and the local db.
I do this:
await item.SynchronizeAsync();
await Context.SynchronizeAsync();
But when I want to update doing this:
var existingWalletT = App.ViewModel.WalletVM.Wallet3.Where(X => X.Id == existingWallet.Id).Select(x => x).FirstOrDefault();
existingWalletT.Id = null;
existingWalletT.Name = tbName.Text;
existingWalletT.pin = tbPin.Text;
existingWalletT.Icon = ((System.Windows.Media.Imaging.BitmapImage)(walletImmage.Source)).UriSource.ToString();
await existingWalletT.SynchronizeAsync();
I get the error below
What am I doing wrong?
I have manually added the column synchronizationid and populated it with the same value as in the Id column hence my table already contained data when I started to add CloudDataSync
Telerik.Windows.Cloud.SynchronizationException: The id parameter type 'System.Guid' is invalid for looking up items of type 'Wallet'. ---> System.InvalidOperationException: The id parameter type 'System.Guid' is invalid for looking up items of type 'Wallet'.
at Microsoft.WindowsAzure.MobileServices.MobileServiceSerializer.EnsureValidIdForType[T](Object id)
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.<LookupAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable`1.<LookupAsync>d__1e.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Telerik.Windows.Cloud.Azure.AzureCloudService`1.<GetItemAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Telerik.Windows.Cloud.SynchronizationContext`1.<Telerik.Windows.Cloud.ISynchronizationContext.SynchronizeItemAsync>d__2.MoveNext()
--- End of inner exception stack trace ---
at Telerik.Windows.Cloud.SynchronizationContext`1.<Telerik.Windows.Cloud.ISynchronizationContext.SynchronizeItemAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Telerik.Windows.Cloud.Azure.AzureSynchronizableCloudItem.<SynchronizeAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WalletViewModel.<UpdateWalletInTable>d__1b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AddWalletPage.<SaveButton_Click>d__33.MoveNext()}