Question

Accessing database when HttpContext.Current is null

I normally get UserConnection from HttpContext and then use it to access the database. Now, when dealing with a business process that starts after a signal, HttpContext.Current is empty. Is there some default UserConnection that I can access?

Like 0

Like

2 comments

Hello Carlos,

 

In order to obtain the UserConnection in the script-task element of the business-process, please use the following syntax:

var userConnection = Get<UserConnection>("UserConnection");

Ok, thank you, it works.

Show all comments