GithubHelp home page GithubHelp logo

aleroe / litedb.extensions Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 4.0 41 KB

Extension methods for setting up LiteDB in Microsoft.Extensions.DependencyInjection.

License: MIT License

C# 100.00%
litedb litedb-extension dependency-injection microsoft-extensions net50 extension-methods

litedb.extensions's People

Contributors

aleroe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

litedb.extensions's Issues

Suggestion for registering collection

Hello,
I've created this extension after using your library. Perhaps you would be interested ? Up to you to decide if you do something with it or not.

https://gist.github.com/timemaster67/6135f0a04225d348b598187e0c04d88d
This allow you to receive a ILiteCollection instance in the constructor of your class, instead of a LiteDatabase instance.

The first method was designed so that I can add as many call to collection.AddTransient as I have LiteDb entity. I would have one call to AddLiteDbRegistries in my startup. Thought it might not be library friendly....

I've added the second method, where you can easily add all your entity to the startup like this
services.AddLiteDbRegistries<Persistence.Entity.xxxxx>(); services.AddLiteDbRegistries<Persistence.Entity.yyyy>();

Do note that I am still new to LiteDb and I am unsure if those should be Transient, scoped or Singleton. You're experience here might know the answer it so I will still share this unfinished idea.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.