11

We're thinking about moving over to Mono and I see that Dapper works with MySql. However this is with a ADO.NET provider. Does Mono/Linux have a MySql ADO.NET provider and does that work with Dapper?

Eventually we are planning on moving our current site from MySql to PostgreSql and I'm also wondering the same question, but also interms of PostrgreSql, Mono and Dapper on linux?

thames
  • 5,833
  • 6
  • 38
  • 45

3 Answers3

10

I'm using Dapper with the official MySqlConnector on an OpenSuse machine (+ mono) and it works great.

Epstone
  • 116
  • 1
  • 2
  • Was there any special configuration or code changes you had to do or did it 'just work'? – thames Jan 24 '12 at 16:56
  • No config changes for dapper compared to the original mysql web.config and connection strings. I'm building asp.net mvc(2) projects with WebDev Express 2010 on Win 7 and upload them to the OpenSuse machine. Even the mvc-mini-profiler then works on mono like it does on windows. :) – Epstone Jan 26 '12 at 16:49
3

Why not pull down the source and build it? Based on this comment from the Dapper home page:

Will dapper work with my db provider?

Dapper has no DB specific implementation details, it works across all .net ado providers including sqlite, sqlce, firebird, oracle, MySQL and SQL Server

...and Mono's ADO.NET implementation, I would think your chances are pretty good that the code will work with little or no modification.

Paul Sasik
  • 79,492
  • 20
  • 149
  • 189
  • I was hoping someone has already tried it out. I currently do not have a mono on linux setup for a test and wanted to see if someone already has this setup and whether or not it works so I don't have to go down a route that wont work if it doesn't. – thames Oct 28 '11 at 21:02
  • I understand. But you can build mono on Windows too, and pretty easily. Prototyping this shouldn't take you more than a couple of hours including downloads, installs and configuration. – Paul Sasik Oct 28 '11 at 21:04
  • 2
    @thames I use mono on Windows - not quite the same test, but at least I'd be well-placed to fix any issues :p I really do think the simplest thing is just "try it", though. I have Ubuntu on my laptop, but I'm not an expert at getting MySQL running on such. – Marc Gravell Oct 28 '11 at 21:07
  • @Gravell - Yeah, I'm going to a wait a week and see if anyone comes along that has tried it. I just don't have a ton of time to tinker at the moment, but hopefully this weekend. – thames Nov 01 '11 at 02:12
  • You might want to put a bounty on the question in that case. Otherwise the chances of someone seeing this question and responding is pretty low. – Paul Sasik Nov 01 '11 at 02:48
2

You don't need to even build Dapper with Mono.

If I were you, first thing I would do is analyse its assemblies with MOMA ( http://mono-framework.com/MoMA ). Even if MOMA reports stuff not implemented in Mono, it may still work for your use case if you don't use the features of Dapper that use the affected parts noticed by MOMA, just try to execute your program under Mono (without recompiling or anything, you can just bring your assemblies to Linux, or execute them in Mono for Windows).

knocte
  • 16,941
  • 11
  • 79
  • 125
  • 1
    Dapper uses extensive meta-programming; MOMA may not spot everything because it *does not exist* at compile-time. – Marc Gravell Oct 29 '11 at 20:32