# IoTSharp.EntityFrameworkCore.MongoDB **Repository Path**: anyplc/IoTSharp.EntityFrameworkCore.MongoDB ## Basic Information - **Project Name**: IoTSharp.EntityFrameworkCore.MongoDB - **Description**: 面向.NET 物联网场景封装的EF Core MongoDB 数据库驱动提供程序,让开发者使用 EF Core、LINQ 统一语法操作 MongoDB 文档数据库,和操作 SQL Server/PostgreSQL 关系库编码方式完全一致。适配框架:.NET 6+、EF Core 6/7/8,兼容 IoTSharp 仓储抽象层,可实现多数据库无缝切换(关系库↔MongoDB 文档库)。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-18 - **Last Updated**: 2026-06-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## IoTSharp.EntityFrameworkCore.MongoDB [![latest version](https://img.shields.io/nuget/v/IoTSharp.EntityFrameworkCore.MongoDB)](https://www.nuget.org/packages/IoTSharp.EntityFrameworkCore.MongoDB) [![preview version](https://img.shields.io/nuget/vpre/IoTSharp.EntityFrameworkCore.MongoDB)](https://www.nuget.org/packages/IoTSharp.EntityFrameworkCore.MongoDB/absoluteLatest) [![downloads](https://img.shields.io/nuget/dt/IoTSharp.EntityFrameworkCore.MongoDB)](https://www.nuget.org/packages/IoTSharp.EntityFrameworkCore.MongoDB) EFCore.MongoDB is a MongoDB mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EFCore.MongoDB works with MongoDB through a provider plugin API. ### Installation EFCore.MongoDB is available on [NuGet](https://www.nuget.org/packages/IoTSharp.EntityFrameworkCore.MongoDB). ```sh dotnet add package IoTSharp.EntityFrameworkCore.MongoDB ``` ### Daily builds We recommend using the [daily builds](docs/DailyBuilds.md) to get the latest code and provide feedback on EF Core. These builds contain latest features and bug fixes; previews and official releases lag significantly behind. ### Basic usage The following code demonstrates basic usage of EFCore.MongoDB . For a full tutorial configuring the `DbContext`, defining the model, and creating the database, see [getting started](https://docs.microsoft.com/ef/core/get-started/) in the docs. ```cs using (var db = new BloggingContext()) { // Inserting data into the database db.Add(new Blog { Url = "http://blogs.msdn.com/adonet" }); db.SaveChanges(); // Querying var blog = db.Blogs .OrderBy(b => b.BlogId) .First(); // Updating blog.Url = "https://devblogs.microsoft.com/dotnet"; blog.Posts.Add( new Post { Title = "Hello World", Content = "I wrote an app using EF Core!" }); db.SaveChanges(); // Deleting db.Remove(blog); db.SaveChanges(); } ``` ### Build from source Most people use EFCore.MongoDB by installing pre-build NuGet packages, as shown above. Alternately, [the code can be built and packages can be created directly on your development machine](./docs/getting-and-building-the-code.md). ### Contributing We welcome community pull requests for bug fixes, enhancements, and documentation. See [How to contribute](./.github/CONTRIBUTING.md) for more information. ### Getting support If you have a specific question about using these projects, we encourage you to [ask it on Stack Overflow](https://stackoverflow.com/questions/tagged/entity-framework-core*?tab=Votes). If you encounter a bug or would like to request a feature, [submit an issue](https://github.com/dotnet/efcore/issues/new/choose). For more details, see [getting support](.github/SUPPORT.md). ## See also * [Documentation](https://docs.microsoft.com/ef/core/) * [How to write an EF Core provider](https://docs.microsoft.com/ef/core/providers/writing-a-provider) * [Code of conduct](.github/CODE_OF_CONDUCT.md)