Devart.Data.MongoDB.EFCore 1.0.248.11

Prefix Reserved
dotnet add package Devart.Data.MongoDB.EFCore --version 1.0.248.11
                    
NuGet\Install-Package Devart.Data.MongoDB.EFCore -Version 1.0.248.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Devart.Data.MongoDB.EFCore" Version="1.0.248.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Devart.Data.MongoDB.EFCore" Version="1.0.248.11" />
                    
Directory.Packages.props
<PackageReference Include="Devart.Data.MongoDB.EFCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Devart.Data.MongoDB.EFCore --version 1.0.248.11
                    
#r "nuget: Devart.Data.MongoDB.EFCore, 1.0.248.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Devart.Data.MongoDB.EFCore@1.0.248.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Devart.Data.MongoDB.EFCore&version=1.0.248.11
                    
Install as a Cake Addin
#tool nuget:?package=Devart.Data.MongoDB.EFCore&version=1.0.248.11
                    
Install as a Cake Tool

NuGet Version NuGet Downloads

dotConnect for MongoDB

dotConnect for MongoDB is an ADO.NET data provider for MongoDB. Its built-in SQL engine exposes MongoDB collections as tables, and Entity Framework Core works over it: LINQ queries are translated to SQL, and SaveChanges inserts, updates and deletes documents.

More information at dotConnect for MongoDB.

Compatibility


The following table show which version of this package to use with which version of frameworks.

Frameworks Version support
Entity Framework Core 11
.NET 11

Installation


For projects using Entity Framework Core 11 with MongoDB, install this package. Execute the following command in the Package Manager Console:

Install-Package Devart.Data.MongoDB.EFCore

MongoDB C Driver


The provider works through the MongoDB C Driver 1.23 (libmongoc). The Devart.Data.MongoDB package carries it for Windows x86 and x64 - libmongoc-1.0.dll, libbson-1.0.dll, sqlite3.dll of the SQL engine and the Visual C++ runtime vcruntime140.dll - and they are copied to the build output: into runtimes\win-x86|x64\native for .NET, into the Native\win-x86 / Native\win-x64 subfolders for .NET Framework. To use other copies, specify their folder with the Native Library Path connection string parameter.

License

See pricing options for ordering.

The NuGet package initiates the retrieval of an activation key from the Devart website. This key is required to activate the product for a free trial.

Usage


This snippet configures a MongoDB connection for an Entity Framework Core DbContext using a connection string.

public class MyDbContext : DbContext {
 
  protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {

     optionsBuilder.UseMongoDB("Host=localhost;Port=27017;Database=test;User Id=user;Password=password;Sql Engine=True;License Key=**********");
  } 
}

The key of an entity is the _id field. A single string key (and a key of the ObjectId type of the MongoDB driver) gets a client-generated ObjectId and is stored as an ObjectId, as are the foreign keys that reference it. To store string keys of your own, configure the key with ValueGeneratedNever(); HasColumnType("text") keeps a generated key a string. Guid keys get a client-generated Guid. On a replica set or a sharded cluster SaveChanges runs in a MongoDB transaction. A standalone server has no transactions: there the changes are applied one by one, and a failure leaves the changes made before it. Set Transactions=Required in the connection string to get an error instead.

  • An owned type (OwnsOne) is stored as an embedded document, a collection of an owned type (OwnsMany) as an array of embedded documents. LINQ queries filter on their fields (c.Address.City == "Rome", c.Phones.Any(p => p.Kind == "home")); a condition on a field of an embedded document goes to MongoDB. Scaffold-DbContext makes owned types of the embedded documents and of the arrays of embedded documents.
  • UseCamelCaseFieldNames() names the fields in camel case.
  • EnableRetryOnFailure() retries the operations that fail with a transient error.

Basic Connection Strings

Property Meaning
Host The name or IP address of the MongoDB server.
Port The port of the MongoDB server, 27017 by default.
Database The database to work with.
User Id The user name.
Password The password of the user.
Sql Engine If True, the collections are queried with SQL as tables; if False, the commands are native MongoDB JSON commands.
License Key Specify your license key in this parameter.

Support Area

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.248.11 0 11/12/2026
1.0.248.10 0 11/12/2026
1.0.248.9 0 11/12/2026
1.0.248.8 0 11/12/2026
1.0.248 0 11/12/2026