How can I change the Id column name in Datasync Client Data object to MyId?

40 Views Asked by At

I synchronize offline and online using Azure Mobile Apps SDK. While doing this, it automatically creates Id, UpdatedAt, Version, Deleted columns in the table. How can I change the **Id ** column name to **AzureId **? Because I have Identity column (ID) from existing table and I should not change it. It can be done this way in EntityTableData. But I couldn't do it on the DatasyncClientData side.

public class TodoItem : DatasyncClientData
 {
        public string Title { get; set; }

        public bool IsComplete { get; set; }
 }

Microsoft document: https://learn.microsoft.com/en-us/azure/developer/mobile-apps/azure-mobile-apps/howto/client/dotnet The DatasyncClientData object includes:

Id (string) - a globally unique ID for the item. UpdatedAt (System.DataTimeOffset) - the date/time that the item was last updated. Version (string) - an opaque string used for versioning. Deleted (boolean) - if true, the item is deleted. The service maintains these fields. Don't adjust these fields as part of your client application.

I tried like this but I get error "Only one member of the type 'Models.TodoItems' may be an Id."

public class TodoItem : DatasyncClientData
 {
        public int ID { get; set; }
        public string Title { get; set; }
        public bool IsComplete { get; set; }
 }
0

There are 0 best solutions below