I am a WPF developer. I am part of a team that has developed an ERP application. I want to convert the application into Blazor Server for the web. I am new to web technology and Blazor.
We have a static class that has nearly 50 properties (only properties, no methods) to store certain data at the application level. We set these property values when the user logs in. After that, we use these values wherever they are required.
Now my question is, how can I use this class in Blazor? I have searched the web and found two ways.
- Add a singleton service. Inject it in wherever required and use its values.
- Use the static class directly wherever required, without service injection.
Which is the best approach in my case, and why?