I hope this helps . As request completes, context gets disposed. Since command handler uses SaveChangesAsync(), context is disposed before save completes. Culprit is controller method :). It should be async as well.
public async Task Delete(Guid id)
var command = new DeleteMember.Command(id);
How exactly add "Service-Worker-Allowed" to register service worker scope in upper folder
Does that help Ok... I was a little confused, and even now I guess I have to get deep in the facts and study http headers better... Anyway as stated in many questions & answer on stackoverflow, it's not possible to alter headers during http request, unless it's not an ajax request (and that's not this case).
fixed the issue. Will look into that further It turns out the code had an if statement on Environment.UserInteractive which told it whether to behave as console or service. In Windows Docker containers, the Environment.UserInteractive always triggers as false for some reason which forced the application to service even when run as a console. We used an environment variable to override the if. Worth noting that apparently in .NET Core, the variable always triggers as true which may be helpful given the way Linux apps are usually triggered.
ASP.NET Core Azure App Service httpContext.Request.Headers["Host"] Value