I am working on a Windows Phone 8.1 app and need to use a database, I didn't that would be an issue until someone asked me what ORM I am using.
So I downloaded & installed the SQLite.net library from http://sqlite.org and added it to my project, I also added the nuget packages and this resolved the errors I was getting.
Now I have created a connection to my database as well as tables based on my models. My question is, where does the ORM come in? What am I not doing that I need to do?
My database is very simple by design, only two tables. The reason I need it is because I will later need to export the data using MS Office APIs.
Please help.
Object Relational Mapping(ORM) – library that allows you CRUD objects from a database without writing SQL statements. The SQLite.NET library is a very lite ORM. It seems that you are doing it right, but you can check it with the following step-by-step instruction:
_connection = new SQLiteAsyncConnection(DatabaseName);
_connection.CreateTablesAsync(typeof(SyncFile), typeof(TransferFile));
await _connection.InsertAsync(entity);
_connection.UpdateAsync(entity);
etc.I would recommend you to use generic repository pattern as well. It can look like: