Can IFormFile be passed into Enqueued job?


#1

Here’s my code. model.ImportFile is a IFormFile object. It doesn’t work. I get a JSON serialization error. How do I pass this object type to an enqueued task?

_backgroundJobClient.Enqueue(() => ImportJob(model.ImportFile,user.Id.GetValueOrDefault())); // Create background task to load import file


#2

It’s hard to believe no one has tried this and succeeded. Is there a workaround for running background tasks that need IFormFile data?