DNXCORE 5.0 和 mysql/mariadb

2022-01-15 00:00:00 mariadb mysql entity-framework dapper dnx50

对于必须针对 Linux 和 Windows 的新项目,我正在寻找支持 MySQL(或 MariaDB)的解决方案.

因为我们必须支持那些不同的平台,所以我希望在 DNX Core5.0 上工作.但是我找不到任何可用于连接数据库的 nuget 包/连接器.DNX core 5.0 不支持我发现的那个.

有没有办法在 DNX core 5.0 中连接到 mysql ?还是你必须依靠 ODBC 连接,我不知道这是否可行......

进一步我正在寻找一个 ORM 来支持这一点,我的研究直到现在发现

  • Entity Framework 7 目前不支持 MySQL.(而 EF 目前不是我最喜欢的 ORM)
  • NHibernate:目前没有人在研究它,将其移植到 DNX Core 将很困难(重大更改)
  • Dapper:(我知道 MicroORM ...):这支持 DNXCore,但我需要一个我无法创建的有效 IConnection.

感谢您的反馈!

罗伯

解决方案

几周前我问了一个类似的问题.DNX Core 没有 MySql 连接器.我不得不退回到 DNX 4.5.1,并且能够在 Docker 容器内运行的项目中使用 MySql 和实体框架.另请参阅回复我的问题.p>

For a new project which has to target Linux and Windows, I am searching for a solution to support MySQL (or MariaDB).

Because we have to support those different platforms I wish to work on DNX Core5.0. However I can't find any nuget packages / connectors which I can use to connect to the database. the one that i find are not supported by DNX core 5.0.

Is there a way to connect to mysql in DNX core 5.0 ? Or do you have to fall back on ODBC connections, i don't know if this would work...

Further i was searching for an ORM to support this, my research till now found out that

  • Entity Framework 7 is not supporting MySQL at this moment. (and EF is not my favorite ORM at this moment)
  • NHibernate: Currently nobody is working on it and it will be difficult (breaking changes) to port it to DNX Core
  • Dapper: (MicroORM I know ...): This is supporting DNXCore but i need a vallid IConnection which I can't create.

Thanks for your feedback!

Rob

解决方案

I asked a similar question a couple of weeks ago. There is no MySql connector for DNX Core. I had to fall back to DNX 4.5.1 and was able to use MySql with Entity Framework in a project that's running inside a Docker container. Also see the response to my question.

相关文章