BrandUp.MongoDB
10.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package BrandUp.MongoDB --version 10.0.2
NuGet\Install-Package BrandUp.MongoDB -Version 10.0.2
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="BrandUp.MongoDB" Version="10.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BrandUp.MongoDB" Version="10.0.2" />
<PackageReference Include="BrandUp.MongoDB" />
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 BrandUp.MongoDB --version 10.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BrandUp.MongoDB, 10.0.2"
#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 BrandUp.MongoDB@10.0.2
#: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=BrandUp.MongoDB&version=10.0.2
#tool nuget:?package=BrandUp.MongoDB&version=10.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
BrandUp.MongoDB
Installation
NuGet-package: https://www.nuget.org/packages/BrandUp.MongoDB/
Configuration
public class WebSiteDbContext : MongoDbContext, ICommentsDbContext
{
public IMongoCollection<ArticleDocument> Articles => GetCollection<ArticleDocument>();
public IMongoCollection<CommentDocument> Comments => GetCollection<CommentDocument>();
}
public interface ICommentsDbContext
{
IMongoCollection<CommentDocument> Comments { get; }
}
[MongoCollection(CollectionName = "Articles")]
public class ArticleDocument { }
[MongoCollection(CollectionName = "Comments")]
public class CommentDocument { }
// Configuration
services.AddMongoDb(options => { options.ConnectionString = "mongodb://localhost:27017"; });
services.AddMongoDbContext<WebSiteDbContext>(options =>
{
options.DatabaseName = "WebSite";
})
.AddExtension<WebSiteDbContext, ICommentsDbContext>()
.UseCamelCaseElementName()
.UseIgnoreIfNull(true)
.UseIgnoreIfDefault(false);
Using
var dbContext = serviceProvider.GetRequiredService<WebSiteDbContext>();
var commentsDbContext = serviceProvider.GetRequiredService<ICommentsDbContext>();
Testing with Mongo2Go
NuGet-package: https://www.nuget.org/packages/BrandUp.MongoDB.Testing.Mongo2Go/
services.AddTestMongoDb();
Testing with BrandUp.MongoDB.Testing
NuGet-package: https://www.nuget.org/packages/BrandUp.MongoDB.Testing/
services.AddFakeMongoDb();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Options (>= 10.0.4)
- MongoDB.Driver (>= 3.7.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on BrandUp.MongoDB:
| Package | Downloads |
|---|---|
|
BrandUp.Pages.MongoDb
Package Description |
|
|
BrandUp.MongoDB.Testing
Package Description |
|
|
BrandUp.MongoDB.Testing.Mongo2Go
Package Description |
|
|
BrandUp.Worker.MongoDB
Package Description |
|
|
BrandUp.CardDav.Server
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.3 | 194 | 3/16/2026 |
| 10.0.2 | 143 | 3/11/2026 |
| 10.0.1 | 207 | 1/3/2026 |
| 8.0.9 | 481 | 7/14/2025 |
| 8.0.8 | 502 | 6/11/2025 |
| 8.0.3 | 348 | 3/29/2025 |
| 8.0.2 | 365 | 3/9/2025 |
| 8.0.1 | 305 | 12/22/2024 |
| 7.3.2 | 522 | 7/9/2024 |
| 7.3.1 | 299 | 7/9/2024 |
| 7.2.5 | 343 | 6/30/2024 |
| 7.2.3 | 432 | 4/29/2024 |
| 7.1.5 | 300 | 4/29/2024 |
| 7.1.4 | 829 | 1/20/2024 |
| 7.1.2 | 516 | 10/3/2023 |
| 7.1.1 | 823 | 3/11/2023 |
| 7.0.2 | 582 | 2/13/2023 |
| 7.0.1 | 793 | 11/10/2022 |
| 3.0.7 | 2,874 | 6/10/2022 |
| 3.0.6 | 2,021 | 4/21/2022 |
Loading failed