Mongodb .NET驱动程序或实体框架 [英] Mongodb .NET driver or entity framework

查看:101
本文介绍了Mongodb .NET驱动程序或实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发API以从C#中读取MongoDB中的数据(仅读取操作)。数据库将是中型。我可以使用Linq或者pefer MongoDB .net驱动程序获取Entity框架。



或者其他任何方法都可以完成此活动吗?



请建议!!!



我尝试过:



使用MongoDB.net驱动程序开发了一个示例应用程序。但是当我加入多个文档时,查询会更复杂

Developing API to read the data from MongoDB (only read operation) in C#. Database would be midsize. Can I go for Entity framework with Linq or pefer MongoDB .net driver.

Or any other approach will accomplish this activity?

Please suggest!!!

What I have tried:

Developed a sample application with MongoDB.net driver. But when I going for joins with multiple documents queries are more complex

推荐答案

您是否使用实体框架是一个偏好问题。没有什么可以说你必须使用它。



不同之处在于你想要的控制量和你想要写的代码量。如果要限制代码量,请使用Entity Framework。如果您想要更好的控制,请跳过框架并编写自己的代码。
Whether or not you use Entity Framework is a matter of preference. There is nothing that says you have to use it.

The difference being the amount of control you want and the amount of code you want to write. If you want to limit the amount of code, use Entity Framework. If you want greater control, skip the framework and write your own code.


这篇关于Mongodb .NET驱动程序或实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆