Skip to content

Scratch-net/MongoRepository

This branch is 6 commits behind RobThree/MongoRepository:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bd1a493 · Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015
Feb 12, 2015

Repository files navigation

Logo Project Description

An easy to use library to use MongoDB with .NET. It implements a Repository pattern on top of Official MongoDB C# driver. This project is now available as a NuGet package for your convenience. If you're new to NuGet, check it out; it's painless, easy and fast. You can find this project by searching for MongoRepository in NuGet (or simply clicking here).

Check the documentation for a step-by-step example and more advanced usage.

Example:

// The Entity base-class is provided by MongoRepository
// for all entities you want to use in MongoDb
public class Customer : Entity 
{
        public string FirstName { get; set; }
        public string LastName { get; set; }
}

public class CustomerRepoTest
{
        public void Test()
        {
            var repo = new MongoRepository<Customer>();

            // adding new entity
            var newCustomer = new Customer {
                FirstName = "Steve",
                LastName = "Cornell"
            };

            repo.Add(newCustomer);

            // searching
            var result = repo.Where(c => c.FirstName == "Steve");

            // updating 
            newCustomer.LastName = "Castle";
            repo.Update(newCustomer);
        }
}

Productivity Visual Studio add-in for C#, VB.NET, XML, XAML, ASP.NET and more

About

Repository abstraction layer on top of Official MongoDB C# driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.9%
  • Shell 0.1%