Does Dapper work on Mono?

2019-06-15 13:33发布

问题:

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?

回答1:

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



回答2:

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.



回答3:

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).