Closed barthamark closed 5 years ago
Can you try with a FlushAsync
?
@barthamark can you try it again with the dev branch where we now commit the session automatically before disposing the shell scope.
It seems that it's working. I was testing with the latest preview NuGet packages and there was no exceptions during the Migrations and the taxonomy was created successfully. Thanks! I'll close this issue now.
Since TaxonomyField requires a TaxonomyContentItemId in their field settings we need to create a Taxonomy content item in the related Migrations step if it doesn't exist already or it's a fresh setup.
What I did is the following:
but it throw an exception:
Based on this answer by @jtkech : https://github.com/OrchardCMS/OrchardCore/issues/3191#issuecomment-466179170
_session.CommitAsync()
worked when I called it right after the CreateAsync.However, I am not sure if this is the best idea to commit the transaction in the middle of the Migrations pipeline.