Gabonet.MongoRepository 0.2.6

dotnet add package Gabonet.MongoRepository --version 0.2.6
                    
NuGet\Install-Package Gabonet.MongoRepository -Version 0.2.6
                    
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="Gabonet.MongoRepository" Version="0.2.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gabonet.MongoRepository" Version="0.2.6" />
                    
Directory.Packages.props
<PackageReference Include="Gabonet.MongoRepository" />
                    
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 Gabonet.MongoRepository --version 0.2.6
                    
#r "nuget: Gabonet.MongoRepository, 0.2.6"
                    
#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 Gabonet.MongoRepository@0.2.6
                    
#: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=Gabonet.MongoRepository&version=0.2.6
                    
Install as a Cake Addin
#tool nuget:?package=Gabonet.MongoRepository&version=0.2.6
                    
Install as a Cake Tool

Gabonet.MongoRepository

Gabonet.MongoRepository es una biblioteca .NET que proporciona una implementación de repositorio genérico para trabajar con MongoDB de manera sencilla y eficiente.

Características

  • Repositorio genérico basado en MongoDB.
  • Soporte para operaciones CRUD (
    • Crear (Create)
    • Leer (Get, GetAll)
    • Actualizar (Update)
    • Eliminar (Delete)
  • Filtros avanzados para consultas.
  • Integración con .NET y compatibilidad con DI (Dependency Injection).
  • Manejo eficiente de colecciones en MongoDB.

Instalación

Para instalar este paquete en tu proyecto, usa el siguiente comando:

 dotnet add package Gabonet.MongoRepository --version 0.2.1

O a través de NuGet Package Manager:

Install-Package Gabonet.MongoRepository -Version 0.2.1

{{ edit_1 }}

  • La versión 0.1.* es para MongoDB.Driver 2.19 hasta 2.28.0
  • La versión 0.2.* es para la versión 2.29.0 en adelante hasta 3.2.1. {{ edit_1 }}

Uso Básico

Configuración

Para comenzar, debes configurar la conexión a MongoDB en tu aplicación .NET:

var settings = new MongoRepositorySettings
{
    ConnectionString = "mongodb://localhost:27017",
    DatabaseName = "MiBaseDeDatos"
};
var repository = new MongoRepository<MyEntity>(settings);

Operaciones CRUD

Insertar un documento
await repository.CreateAsync(new MyEntity { Id = "1", Name = "Ejemplo" });
Obtener un documento por ID
var entity = await repository.GetByIdAsync("1");
Obtener todos los documentos
var allEntities = await repository.GetAllAsync();
Actualizar un documento
entity.Name = "Nuevo Nombre";
await repository.UpdateAsync(entity);
Eliminar un documento
await repository.DeleteAsync("1");

Contribuir

Si deseas contribuir a este proyecto, siéntete libre de enviar un Pull Request o reportar un issue en el repositorio oficial.

Licencia

Este proyecto está bajo la licencia MIT.


Nota: Si tienes algún problema o sugerencia, por favor abre un issue en GitHub.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
0.2.6 206 4/10/2025
0.2.5 162 4/10/2025
0.2.4 420 3/24/2025
0.2.3 341 3/24/2025
0.2.2 305 3/12/2025
0.2.1 202 3/7/2025
0.2.0 206 3/7/2025
0.1.0 203 3/7/2025