I have an async controller and I am trying to call two different Async functions from it. like this
public async void Approvefiles(string[] data)
{
var response = await _mediator.Send(new persons.Query(data));
await _mediator.Send(new employees.Query(data));
}
All looks good to me, But this throws an error
System.ObjectDisposedException: 'Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.'
Can anyone point out what I am doing wrong here? And this error doesn't occur if I call only one async function (for exaple persons.Query only).