(I use the term "asynchronously" freely in the subject)
I used the code below to store the initial session context information in the database, such as branch details for later tracking. I suggested that others use this concept to speed up some of their processes, but I would not want to offer something potentially dangerous.
I would like to know if this is permissible or are there any problems with the flows that I will cause later on the road during peak traffic hours?
new Thread(() => {
//All my logic for saving info to DB
})
{ Name = "My long running page process", IsBackground = true, Priority = ThreadPriority.Normal }.Start();
UPDATE
Thank! After David Basarab's answer, I think this will be my new method:
Action someLongProcess = () =>
{
// You DB Work
};
someLongProcess.BeginInvoke((x) => {
someLongProcess.EndInvoke(x);
// It is now done you can do something
}, null);