homemade-di
EstEID.Blazor
homemade-di | EstEID.Blazor | |
---|---|---|
1 | 2 | |
0 | 0 | |
- | - | |
0.0 | 0.0 | |
over 2 years ago | almost 3 years ago | |
C# | C# | |
- | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
homemade-di
-
Homemade DI: The How's and Why's of Dependency Injection (in dotnet)
I hope the concept of dependency injection is clear to you now. Feel free to look up the final code on GitHub as I worked a little bit on it for improvements and also tested it for the various use-cases.
EstEID.Blazor
-
How to load data when Blazor server starts (and understanding of singleton)
If I understand correctly you can have make a class that gets initialized on startup. For singleton the constructor can have a task that wont resolve which isnt ideal but will work. How many queries you make to the database then is your own to implement. For example lets say we use entitiyframework. You can make a permarunning task in a singleton class constructor that will just keep some data in memory. Then that Task calls the savechanges() every one hour. If there is a power outage obviously you will have hour lost of data but thats not the question. That class will get initialized on program startup and will keep running until you shut it down. I did long ago a tool to read data from Smart Cardsthat utilized a singleton class to fire events and then blazor to use as UI. The idea is that since there is ever only 1 instance of that class the events fired will propagate to every subscriber. This way you can have a client to display data, a client to say log info etc. Similar approach can be used to handle data in your case. You can attach several "screens" through browser to make same data be displayed in several locations etc. The public bit i can share as an example is here: https://github.com/elraito/EstEID.Blazor. It is trivial to track when something gets initilized or fires since we do have console.writeline() :)
- Show same state to all users
What are some alternatives?
Autofac - An addictive .NET IoC container
Blazorise - Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Bulma, AntDesign, and Material. [Moved to: https://github.com/Megabit/Blazorise]
Simple Injector - An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
MudBlazor - Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
bna-language - A simple "assembly-like" programming language designed for teaching students new to computer science.
BlazorChatSample - A sample Blazor chat application using SignalR
Entity Framework - EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.