Losing ClientContext calling DataPortal from within ASP.NET Core #1869
-
I'm working on a proof of concept using a Console project and I am trying to implement a remote data portal following the model of the Project Tracker sample, but using the object factory model. In my use case, the object factory Fetch method calls CheckRules, and one of the rules being executed calls DataPortal.Fetch on a different object. When debugging iisexpress, a breakpoint in the rule, just before it calls the DataPortal.Fetch, shows ClientContext settings that were passed from the console project. A breakpoint in the second object's Fetch method have an empty ClientContext. I originally had the problem on 5.1.0, but have upgraded to 5.3.2 and still have the problem. This is all running on Windows and using VS2019. If I uncomment app.UseCsla from the host startup configuration, the client context is available from the object being instantiated by the rule. My real question is whether I am going to get in trouble by not calling app.UseCsla. The workflow from a high-level perspective
The console class Main method:
Relevant parts from the ASP.NET Core host:
Execute method from the rule
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I believe this is the same issue as #1790, and the direct workaround/solution is to use the |
Beta Was this translation helpful? Give feedback.
I believe this is the same issue as #1790, and the direct workaround/solution is to use the
ApplicationContextManagerTls
instead of the default context manager.