MongoDB and Entity Framework Core 2.0

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-12 05:12:26

问题


So, I've read repeatedly that EF Core will support NoSQL databases but I can't seem to find any "official" NoSQL database providers, or even a NoSQL framework in the source code. (By "find" I mean search for "nosql".)

I've had a quick look at ADO.NET (paid) and crhairr/EntityFrameworkCore.MongoDb but they are both third-party. MongoDB (the specific database I was looking into) has their own .NET driver but it doesn't seem to integrate EF Core.

Anyway, what I really want to know is:

  1. Does/will EF Core support NoSQL databases? What does "support" entail?
  2. Does/will the MongoDB .NET driver support EF Core?

The results of my research so far seem to indicate that I'm misunderstanding something and it would be great if anyone could point it out.


回答1:


Currently, the 2.1 EF Core roadmap doesn't show any new providers for NoSQL DBs. (https://docs.microsoft.com/en-us/ef/core/what-is-new/roadmap)

Yet, they are now focused for Azure Cosmos, which is a cloud DB service. In Cosmos, you can use MongoDB API. More info about the progress (https://github.com/aspnet/EntityFrameworkCore/issues/8443) and Cosmos & MongoDB( https://docs.microsoft.com/en-us/azure/cosmos-db/create-mongodb-dotnet)

For non third party MongoDB provider, it will take some time. You must understand, that .NET Core is a huge change from .NET Framework, because it now embodies the open source culture. Many libraries and tools are available and will be available without "Made by Microsoft" stamp. It's up for the community to create libraries and tools for .NET Core.




回答2:


If someone reach to this place, now Microsoft support MongoDb with EF Core in .NET Core 2.2.

Please check in here.

https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mongo-app?view=aspnetcore-2.2&tabs=visual-studio



来源:https://stackoverflow.com/questions/46218719/mongodb-and-entity-framework-core-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!