Devart.Data.MongoDB.EFCore 1.0.248

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Devart.Data.MongoDB.EFCore --version 1.0.248
                    
NuGet\Install-Package Devart.Data.MongoDB.EFCore -Version 1.0.248
                    
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" />
                    
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" />
                    
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
                    
#r "nuget: Devart.Data.MongoDB.EFCore, 1.0.248"
                    
#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
                    
#: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
                    
Install as a Cake Addin
#tool nuget:?package=Devart.Data.MongoDB.EFCore&version=1.0.248
                    
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 3
.NET Core 3.1
.NET Framework 4.8, 4.7.2

Installation


For projects using Entity Framework Core 3 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 is stored as an embedded document (Address.Street).
  • 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 net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
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 96 11/12/2026
1.0.248.10 89 11/12/2026
1.0.248.9 85 11/12/2026
1.0.248.8 93 11/12/2026
1.0.248 92 11/12/2026