Azure App Service Mobile App database synchronization failes if data is deleted

174 views Asked by At

I'm currently facing such a problem: I'm building an app using Xamarin and Azure App Service Mobile App as a cloud back-end. The thing is that if I delete some data from the corresponding table in DB hosted in Azure the next PullAsync call on mobile device fails because it tries to request the deleted record. Is there any way to synchronize the deletion of the records which happens first in Azure DB and then is pulled to the device?

The other way works smoothly: if I delete the record from the device, the corresponding record is deleted in Azure DB.

1

There are 1 answers

5
François On BEST ANSWER

You have to use soft delete by enabling is on your server for each TableController where you require it. Example here for a TodoItem TableController.

protected override void Initialize(HttpControllerContext controllerContext)
{
    base.Initialize(controllerContext);
    MobileServiceContext context = new MobileServiceContext();
    DomainManager = new EntityDomainManager<TodoItem>(context, Request, enableSoftDelete: true);
}

More info here.