© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
13 replies
deathlybower959

Blazor Services

I dont know too much blazor, but I have a .cs file in a /Settings folder, in which I would like to access a service which is storing state. (The service called
State
State
is stored in /Appearance).

In razor components, i can just use
@inject State state
@inject State state
, and then access and modify it using
state.<prop>
state.<prop>


How can i do the same inside of a standard c# file?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Blazor WASM - Hosted Services During Debug
C#CC# / help
4y ago
blazor
C#CC# / help
2y ago
❔ blazor
C#CC# / help
3y ago
identity blazor
C#CC# / help
2y ago