Closed WanjohiSammy closed 1 month ago
@WanjohiSammy The linked issues says it's getting the error message "An asynchronous operation is already in progress". And this PR description says it's fixing the error "Synchronous I/O is not allowed". What shows that these two problems are related or this this PR is fixing the linked issue?
@WanjohiSammy The linked issues says it's getting the error message "An asynchronous operation is already in progress". And this PR description says it's fixing the error "Synchronous I/O is not allowed". What shows that these two problems are related or this this PR is fixing the linked issue?
@habbes I have updated the PR description to reflect the issue correctly.
@WanjohiSammy Given the significant changes made to EdmModelCsdlSerializationVisitor
and EdmModelVisitor
classes, please ensure/confirm that the tests that you added sufficiently cover all the changes and all execution paths
Issues
This pull request fixes #1320.
Description
Briefly describe the changes of this pull request.
Refactors the code to use the asynchronous method
VisitCollectionAsync
instead of the synchronousVisitCollection
. The VisitCollectionAsync method has the second parameter asFunc<T, Task>
as opposed to VisitCollection which has the second parameter asAction<T>
. This change ensures that the method is awaited properly, maintaining the correct order of execution in an asynchronous context.The
ProcessEntityContainerAsync
passed as argument toVisitCollectionAsync
is an asynchronous method that processes the entity container and at the endWriteEndElementAsync
is called to write the end element. Using VisitCollectionAsync ensures that the ProcessEntityContainerAsync method is awaited before the end element is written and thus prevents the exceptions like below:Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.