Skip to content
This repository has been archived by the owner on Jul 24, 2022. It is now read-only.

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.

License

Notifications You must be signed in to change notification settings

IoTSharp/IoTSharp.EntityFrameworkCore.MongoDB

Repository files navigation

IoTSharp.EntityFrameworkCore.MongoDB

latest version preview version downloads

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.

dotnet add package IoTSharp.EntityFrameworkCore.MongoDB

Daily builds

We recommend using the daily builds 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 in the docs.

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.

Contributing

We welcome community pull requests for bug fixes, enhancements, and documentation. See How to contribute for more information.

Getting support

If you have a specific question about using these projects, we encourage you to ask it on Stack Overflow. If you encounter a bug or would like to request a feature, submit an issue. For more details, see getting support.

See also

About

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.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published