I have a normal Universal App, nothing fancy, really simple.
There is a SQLite database that weights more than 200KB (could be even 20MB, keep that in mind) and I want to share this database between Windows 8.1 and Windows Phone 8.1 devices.
I guess that roaming data isn't enough, am I right?
So, I googled and find Azure Mobile Services and it's really sweet but the examples that are provided are too simply and I don't know how to extend it.
My database has 7 tables and some of them are connected by foreign key. Here is example one of my class (database is based on it).
public class Meeting : INotifyPropertyChanged
{
public Meeting() { }
private int _id;
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
private int _adressId;
public int AdressId { get; set; }
private Adress _adress;
[Ignore]
public Adress Adress { get; set; }
}
Then it is method
private async Task InitLocalStoreAsync()
{
if (!App.MobileService.SyncContext.IsInitialized)
{
var store = new MobileServiceSQLiteStore("MyDatabase.db");
store.DefineTable<Adress>();
store.DefineTable<Contractor>();
store.DefineTable<Item>();
store.DefineTable<ItemGroup>();
store.DefineTable<Meeting>();
store.DefineTable<Note>();
store.DefineTable<Order>();
await App.MobileService.SyncContext.InitializeAsync(store);
}
}
and I get exception "Error getting value from 'Adress' on 'Projekt.DataModel.Meeting'."
The thing is: It is really hard to work with this. Isn't there a simplier solution? I don't need at this moment nothing but synchronization of my database. Please remember that I have a tables that are connected by foreign key. Maybe I skip some worthy example or tutorial?
Thanks for all your help.
Aucun commentaire:
Enregistrer un commentaire