Entity Framework and MongoDb

Solution 1:

Short answer - no, it's for sure possible, but not reasonable.

MongoDB is document database and not support any physical relations between collections. EF is a good fit for relational databases like SQL, MySQL, etc. MongoDB works faster with embedded documents. So it's just two different approaches.

Solution 2:

Check out the latest version of the MongoDB C# Library.... supports LINQ!

https://mongodb.github.io/mongo-csharp-driver/1.11/linq/

Solution 3:

I'm a big fan of entity framework, so when I first tried out mongoDb I've created a library called "MongoDB.Dynamic" that has an approach next to EF Code First. MongoDB has no relations between collections physically, but you can simulate it. MongoDB.Dynamic has a feature known as Eager Loading that you can configure relationships between collections and load related documents automatically if an entity have the conventioned structure. You can try and read some documentation at MongoDB.Dynamic