Thursday, May 16, 2019

MongoDB.Entities v4.1 Released

The goal of this library is to simplify access to mongodb by wrapping up the official C# mongodb driver and providing some additional features on top of it. The API is clean and intuitive resulting in less lines of code that is more readable/ human friendly than driver code.

Advantages:

  • Never have to deal with ObjectIds or BsonDocuments.
  • Everything is type safe. No magic strings needed.
  • Model your entities in either Document/NoSQL stye or Relational/SQL style or a mix of both.
  • Built-in automatic support for One-To-One, One-To-Many and Many-To-Many relationships.
  • Data can be queried using either LINQ or lambda expressions.
  • Programatically define indexes.
  • Full text search with text indexes.
  • Supports both ASP.Net Core and .Net Core applications.

    Code Sample

    ```csharp //Initialize database connection new DB("bookshop");

    //Create and persist an entity var book = new Book { Title = "The Power Of Now" }; book.Save();

    //One-To-Many relationship var tolle = new Author { Name = "Eckhart Tolle" }; tolle.Save(); book.Authors.Add(tolle);

    //Query var eckhart = DB.Collection<Author>() .Where(a => a.Name.Contains("Eckhart")) .SingleOrDefault(); //Delete book.Delete(); ```

    Wiki/Getting Started

    in order to get started using the library please see the wiki pages.

MongoDB.Entities v4.1 Released Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team