Ba.Infrastructure.Persistence.Mongo
1.0.2
dotnet add package Ba.Infrastructure.Persistence.Mongo --version 1.0.2
NuGet\Install-Package Ba.Infrastructure.Persistence.Mongo -Version 1.0.2
<PackageReference Include="Ba.Infrastructure.Persistence.Mongo" Version="1.0.2" />
<PackageVersion Include="Ba.Infrastructure.Persistence.Mongo" Version="1.0.2" />
<PackageReference Include="Ba.Infrastructure.Persistence.Mongo" />
paket add Ba.Infrastructure.Persistence.Mongo --version 1.0.2
#r "nuget: Ba.Infrastructure.Persistence.Mongo, 1.0.2"
#:package Ba.Infrastructure.Persistence.Mongo@1.0.2
#addin nuget:?package=Ba.Infrastructure.Persistence.Mongo&version=1.0.2
#tool nuget:?package=Ba.Infrastructure.Persistence.Mongo&version=1.0.2
Ba.Core.Persistence.Mongo
A modern and extensible Entity Framework Core–based Persistence Library designed for scalable, clean, and maintainable .NET applications.
Features
- Generic MongoDB Repository Pattern
- Soft Delete support (DeletedDate)
- Date-based auditing (CreatedDate, UpdatedDate)
- Pagination utilities (
Paginate,ToPaginateAsync) - Dynamic Querying (Filter, Sort, Nested Filters)
- Async CRUD operations
- Clean Architecture & DDD compatible
- Minimal configuration, plug-and-play usage
Installation
Install via .NET CLI:
bash
dotnet add package Ba.Core.Persistence.Mongo
Or via NuGet Package Manager:
powershell
Install-Package Ba.Core.Persistence.Mongo
Basic Usage
- Program.cs
builder.Services.Configure<MongoSettings>( builder.Configuration.GetSection("MongoSettings"));
builder.Services.AddSingleton<MongoContext>(); builder.Services.AddScoped(typeof(IMongoRepositoryAsync<>), typeof(MongoRepositoryBase<>));
- Appsettings.json
"MongoSettings": { "ConnectionString": "mongodb://localhost:27017", "Database": "MyAppDb" }
Example Document
public class User : BaseDocument { public string Name { get; set; } public string Email { get; set; } }
Example Usage
var user = await _userRepository.GetAsync(x ⇒ x.Email == "demo@example.com");
License
This project is licensed under the MIT License.
Contributing
Contributions, issues, and feature requests are welcome! Feel free to open a Pull Request or create an Issue on GitHub.
| 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. |
-
net10.0
- Core.Abstractions (>= 1.0.1)
- Humanizer.Core (>= 3.0.1)
- Microsoft.Extensions.Options (>= 10.0.0)
- MongoDB.Driver (>= 3.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.