2

I'm just wondering what people are using for a Data Access Layer in Monotouch? I'm working on a CRUD based app, and looking for something in between writing inline SQL or rolling my own ORM, and trying to wedge Entity Framework into the mix when it's not supported.

I'm tempted to try and use Simple.Data, but I'm not sure if it would even compile under Mono.

Kye
  • 5,919
  • 10
  • 49
  • 84

1 Answers1

3

The answers depends on whether you want to store the data on-device or off (or, of course, both).

For on-device storage, you can use the Sqlite database baked into iOS and access it through the Mono.Data.Sqlite driver.

For off-device storage, I would recommend using a self-baked web service.

competent_tech
  • 44,465
  • 11
  • 90
  • 113
  • The Sqlite assembly would still require inline SQL wouldn't it? – Kye Apr 05 '12 at 12:49
  • Yes, it does require inline SQL, it doesn't support stored procs. What we do is use reflection to generate the SQL based on the properties in the class that needs to be written, which greatly reduces the amount of SQL that has to be written and maintained. – competent_tech Apr 05 '12 at 16:22
  • 2
    There's also Frank Krueger's SQLite.Net binding (which is what Miguel used in TweetStation): https://github.com/praeclarum/sqlite-net which has an Orm built-in. – jstedfast Apr 06 '12 at 01:26