Код: Выделить всё
public static async Task CallBackMethod(HttpRequestMessage request, string entityId, Func getEntity, Func action, string actionId) where T : Meta
{
// Changing to ConfigureAwait(true) ensures no Stackoverflow exception
request.Properties[Before] = await getEntity.Invoke(entityId).ConfigureAwait(false);
request.Properties[Target] = typeof(T).Name;
// Custom Exception is thrown from action.Invoke()
await action.Invoke().ConfigureAwait(false);
request.Properties[After] = (Func)(async () => await getEntity.Invoke(entityId).ConfigureAwait(false));
request.Properties[ActionId] = actionId;
}
Код: Выделить всё
request.Properties[Before] = await getEntity.Invoke(entityId).ConfigureAwait(true)
< /code>
Тогда исключение переполнения стека не брошено. Только ожидаемое пользовательское исключение брошено и обрабатывается. брошен. Я хотел понять, что меняется между configureawait (false)
https://github.com/riteshksriv/testso
Подробнее здесь: https://stackoverflow.com/questions/794 ... -asp-net-a