0

Currently looking at the Enable Offline Sync for Xamarin Form : https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-offline-data.

I am having the code running on mobile and the backend run and created ToDoList table with 2 entries. The table created in ToDoList has UpdateAt, Version and Deleted columns create from the controller which extends TableController.

In existing web application currently already using the database with tables, do I have to create all the tables with UpdateAt, Version and Deleted columns. I am unsure how this data generated for those columns in web application so that both mobile and web data can be consistent.

LittleFunny
  • 8,155
  • 15
  • 87
  • 198

1 Answers1

1

This free online book will go through details of getting the backend setup.

https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter3/dataconcepts/

One of the ways described is to you EF already built in Code-First with migrations, and have a base class that looks like this

public abstract class TableData
    {
        public string Id { get; set; }
        public DateTimeOffset? UpdatedAt { get; set; }
        public byte[] Version { get; set; }
    }

Those are the table properties missing you asked about.

ChampChris
  • 1,565
  • 5
  • 26
  • 44
  • Thanks. Yea i know it will create this columns for mean in the database but what if my existing tables used by the web application doesn't have this columns. Do I need to add them manually? coz it can be troublesome coz webapp not considered this scenerio – LittleFunny Feb 11 '20 at 23:42
  • Yes have to add them manually to the DB or with a migration. Your Webapp should be protected from the entity changes, by projecting to to models in your linq queries. the backend server piece is this article https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-dotnet-backend-how-to-use-server-sdk – ChampChris Feb 12 '20 at 13:20
  • Just found this yesterday https://azure.microsoft.com/en-us/updates/removing-easy-tables-and-easy-apis-from-azure-app-service/ – ChampChris Feb 12 '20 at 13:22