I'm implementing the onion architecture with webapi, service layer, repository, unit of work and the domain classes. I use also DI, using simple injector.
But my issue, is how can I implement a specific use case.
- The webapi should have the ability to receive a batch of files from the ui. After they are received they should be parsed and the database should be updated with the parsed data.
- The UI shouldn't be waiting for the request, so the user can go on doing his thing.
So, since i'm using entity framework context to access database and setting it's lifetime dependent on the http request on the DI container, how can i be able to process the files and storing them if my request it's already dead?
I'm looking for a elegant solution, but for now i didn't came up with none, so any help would be appreciated here.