aleroe / litedb.extensions Goto Github PK
View Code? Open in Web Editor NEWExtension methods for setting up LiteDB in Microsoft.Extensions.DependencyInjection.
License: MIT License
Extension methods for setting up LiteDB in Microsoft.Extensions.DependencyInjection.
License: MIT License
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.