You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ef-core-migrations.md, there are some codes has runtime error!
After creating a MigrationsService and Worker.cs,just like:
privatestaticasyncTaskRunMigrationAsync(CommandDbContextdbContext,CancellationTokencancellationToken){varstrategy=dbContext.Database.CreateExecutionStrategy();awaitstrategy.ExecuteAsync(async()=>{// Run migration in a transaction to avoid partial migration if it fails.awaitusingvartransaction=awaitdbContext.Database.BeginTransactionAsync(cancellationToken);awaitdbContext.Database.MigrateAsync(cancellationToken);awaittransaction.CommitAsync(cancellationToken);});}
Afte running AspireHost, I got an error: User transaction is not supported with a TransactionSuppressed migrations or a retrying execution strategy.