MongoRepo 1.0.6

Install-Package MongoRepo -Version 1.0.6
dotnet add package MongoRepo --version 1.0.6
<PackageReference Include="MongoRepo" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MongoRepo --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MongoRepo, 1.0.6"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MongoRepo as a Cake Addin
#addin nuget:?package=MongoRepo&version=1.0.6

// Install MongoRepo as a Cake Tool
#tool nuget:?package=MongoRepo&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Tutorials Link: https://www.youtube.com/watch?v=VLIpr5-TVHc&list=PLqCbg_KAOnCepoj76b0ontM6_0nXGdrsg

Suppose you want to add student data into the mongodb database.

Create a “Student” entity model. Then you have to add an interface “IStudnetManager” and inherit “ICommonManager” with set your model name.

      interface IStudentManager:ICommonManager<Student>
         {
         }

If you need another custom method for your custom logic then you can add definition in this interface.Other wise it will be empty when you feel the need to write a new method then add method definition. Note : You have to add 2 namespaces using MongoRepo.Interfaces.Manager;

Create a class “StudentRepository” inherited from “CommonRepository” class with a set Student model. Sample class. class StudentRepository:CommonRepository<Student> { Public StudentRepository():base(new ApplicationDbContext(“dbconnection”,”db name”)) { } }

Note : You have to add 2 namespaces using MongoRepo.Context; using MongoRepo.Repository;

3.Create a class “StudentManager” inherited from “CommonManager” class with a set Student model and also inherit “IStudentManager” and create “StudentManger” constructor using StudentRepository object. Sample class.

class StudentManager:CommonManager<Student>,IStudentManager { public StudentManager() : base(new StudentRepository()) { } } Note : You have to add 3 namespaces using CRUDMongoDb.Interfaces.Manager; using CRUDMongoDb.Repository; using MongoRepo.Manager;

Finally you have to create an object “StudentManager” class then find all of the methods for CRUD operation. StudentManager _studentManager=new StudentManager() For student single entry _studentManager.Add(studentObject); For student collection entry _studentManager.Add(studentObjectList); For student data modify _studentManager.Update(id,studentObject); For delete student _studentManager.Delete(id); Get one single object studentManager.GetById(); Get all data studentManager.GetAll();

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
1.0.6 326 9/6/2020
1.0.5 259 9/6/2020
1.0.4 254 9/6/2020
1.0.3 215 8/19/2020
1.0.2 212 8/19/2020
1.0.1 232 8/19/2020
1.0.0 177 8/19/2020