Changhui Xu
1 min readMar 6, 2020

--

Hi Tex Ranger,

Yes, in your case, the “short-lived” service is your upload job.

If you want to have the file name from the event, you can pass it to the Run() method. For example,

in the Worker class

_serviceA.Run(e.FullPath);

In the ServiceA class

public void Run(string fileName)
{
// do your stuff with "fileName"
}

Now, the Run method has a parameter, so you need to update the IServiceA interface as well.

--

--

Changhui Xu
Changhui Xu

Written by Changhui Xu

Lead Application Developer. MBA. I write blogs about .NET, Angular, JavaScript/TypeScript, Docker, AWS, DDD, and many others.

No responses yet