在 MonoTouch 中使用 Dapper
由于我是 Dapper 的忠实粉丝,并将其用于几个 SQL Azure 项目,因此我也想在 MonoTouch 上使用它,而不是内置的 Mono.Data.SQLite。
我意识到 Dapper 的速度来自动态代码生成,不幸的是,这在 iOS 上是一个很大的禁忌,因为所有内容都必须由 MonoTouch 提前编译。
第一个问题:是否有人做出过努力来提供 dapper 相关部分的基于反射的实现? (我知道这会慢很多)如果不是的话,实现它会有多难(只浏览了一下 Dapper 源代码)。
第二个问题:我希望我在这里听起来并不天真,但是是否可以远程编写一个小实用程序,将实体 POCO 的动态生成的 IL 具体化为 IL 程序集源文件,该文件可以添加到您的 MonoTouch 项目中,从而获得在构建期间 AOTed?或者由于连接和 QueryMultiple 等原因这是不可能的?
注意:我意识到至少有一次尝试将Dapper移植到MonoTouch,但浏览一下源代码我没有知道它应该如何飞行,因为所有动态方法生成的东西仍然在那里。
Since I'm a big fan of Dapper and using it for a couple SQL Azure Projects I would like to use on MonoTouch as well against the built-in Mono.Data.SQLite.
I realize that Dapper's speed comes from the dynamic code generation which unfortunately is a big no-no on iOS where everything has to be compiled ahead-of-time by MonoTouch.
First question: Has anyone made any efforts to provide reflection based implementation of the relevant parts of dapper? (I know it will be a LOT slower) If not how hard would it be to implement it (only glanced over the Dapper source).
Second question: I hope I am not sounding naive here but would it be remotely possible to write a little utility that would materialize the dynamically generated IL for your entity POCOs into an IL assembly source file that could be added to your MonoTouch project and thus gets AOTed during build time? Or is this impossible due to joins and QueryMultiple etc?
Note: I realize there is at least one attempt to port Dapper to MonoTouch but glancing over the source I have no idea how's that supposed to fly since all the dynamic method generation stuff is still in there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论