Razor Page and ApplicationContext.ClientContext #3414
-
I'm using CSLA 7 with Blazor Server. I'd like to pass the connection string to my business objects using Client Context. I'm getting compile errors trying to access ApplicationContext.ClientContext from a razor page this line Csla.ApplicationContext.ClientContext["DatabaseName"] = "Sample Company"; gives me an error that An object reference is required for the non-static field, method or property. Any suggestions on how to reference ClientContext from a razor page would be appreciated. Thanks, Mike |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In CSLA 7 there is no longer a static @inject Csla.ApplicationContext applicationContext; |
Beta Was this translation helpful? Give feedback.
In CSLA 7 there is no longer a static
Csla.ApplicationContext
. Instead, you must inject theApplicationContext
service into a page or anywhere else that you need to use it.