We are pleased to announce that the MongoDB Provider for Entity Framework Core (EF Core) is now available in Public Preview. This makes it possible for developers using EF Core to build C#/.NET applications with MongoDB and take advantage of our powerful developer data platform while continuing to use APIs and design patterns they already know and love.
Building for the C#/.NET community
Nearly one-third of all developers use C# to build applications, with the population of C# developers reaching upwards of 10 million developers worldwide. Forty-one percent of C# developers use EF Core, which is beloved as an abstraction layer to simplify working with data during development. In the past, C# developers could use MongoDB’s C# driver but didn’t have first-party support for EF Core; some turned to community-built projects that could be helpful but lacked official backing or ongoing support from MongoDB.
With the official MongoDB Provider for EF Core now available in Public Preview, developers can use C# and EF Core with confidence when building with MongoDB.
What's in the New Provider for EF Core
In this initial Public Preview release, the MongoDB Provider for EF Core offers developers the following capabilities:
- Support for code-first workflows: Allows users to build without an initial database; you first create the classes for your application and then match your data model to the classes, not the other way around.
- Basic CRUD methods: Basic create, read, update, and delete (CRUD) operations are supported.
- String and numeric type operators: String and numeric type operators needed for basic CRUD operations will be supported. We anticipate adding support for more complex operators in future iterations of the Provider.
- Embedded documents: The Provider supports embedded documents, making it easier to store related information in the same database record.
- Class mapping and serialization: Your classes in C# will map to MongoDB in a predictable way, including when working with IDs as well as date and/or time values.
- LINQ query support: The Provider will support LINQ3 queries with fluent query syntax.
- Change tracking: The Provider allows you to track and save changes made to entities with each DbContext instance back to your MongoDB database.
And this is just a start. Stay tuned for more advanced functionality when we release the MongoDB provider in General Availability (targeted for 2024).
Benefits of using the provider for EF Core
With the MongoDB Provider for EF Core, C# developers can unlock the full power of MongoDB's developer data platform to build modern applications while leveraging a familiar API interface, query paradigm (LINQ), and design patterns. Developers looking to modernize their data layer can do so with MongoDB while remaining free from cloud vendor lock-in since MongoDB works with all major cloud providers and for multi-cloud deployments
How to get started with MongoDB Provider for Entity Framework Core
All you need to do is download the MongoDB Provider for EF Core from the NuGet package manager and build a DbContext that points to a MongoDB Provider instance. The Provider connects to MongoDB and handles the rest, so you can quickly harness the joint value of EF Core and MongoDB.
You can learn more by diving into our documentation. After you try the new Provider for EF Core, feel free to leave us feedback in our user feedback portal. Your input is important for helping us continue to improve the product experience.
Get started today to unleash the power of your data with MongoDB and EF Core.