In your code,
daService
is a static field within the
Program
class. To access it from another class, you would need to prefix the field name with the class name:
Program.daService.str1
However, this is almost certainly the wrong thing to do.
Since you have declared the instance as a static field, that single instance will be shared across the entire process. Every single request that comes in will be accessing the same instance, and each request will be accessing it from a different thread. Not only will you have thread-safety issues to worry about, but if you're using the class to store anything related to a request, then you will end up with data "leaking" between requests.
It would almost certainly be better to use dependency injection:
ASP.NET Core Blazor dependency injection | Microsoft Learn[
^]
If the data in your class relates to a single request, register it as a "scoped" service.
If it's genuinely a "singleton" service, then it should ideally be immutable.