Skip to content Skip to sidebar Skip to footer

Set Up MySQL Back-end In Azure For Xamarin Offline Sync

I have a MySQL database set up through the Azure Portal, currently hosted on ClearDB. I have created a mobile app using Xamarin Forms that implements an SQLite database which store

Solution 1:

According to your requirement, I tried to create my Azure Mobile App project via Visual Studio, and install MySql.Data.Entity 6.9.9 which supports MySQL for EF6, then create my table controller working with my DBContext for MySQL.

I created my db model that inherits the EntityData which contains the table column type DateTimeOffset, but I encountered a incompatible error message. Then I found there is a known bug in MySQL Connector as follows:

An Entity Framework DbContext object created with a column of type DateTimeOffset returned an error indicating that DateTimeOffset values were incompatible with DateTime and Timestamp values. (Bug #24732001)

I found a release note about MySQL Connector/NET, then I tried to upgrade to MySql.Data.Entity 7.0.7-m61, but another problem about TypeLoadException - MySqlEFConfiguration encountered.

Since your goal is to use offline sync for your Xamarin app with azure mobile app, I recommend that you could try to use sql database or azure table storage for your data storage instead of MySQL, which could build your mobile app backend in a simple way. You could refer to here for getting started with it.


Post a Comment for "Set Up MySQL Back-end In Azure For Xamarin Offline Sync"