Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Salome 5 posts 95 karma points
    Apr 12, 2023 @ 20:51
    Salome
    0

    Umbraco Upgrade - Scope.Complete() doesn't update database but returns true.

    I have upgraded Umbraco from v7 to v11 and come across to several issues working with custom tables. Whenever I inserting/updating table, everything seems to work fine but changes are not in the database.

    Here is the code:

    using (var scope = _scopeProvider.CreateScope()) { var db = scope.Database; await db.InsertAsync(obj); //Id is successfully created. scope.Complete(); //this return true, successfully committed. }

    I have also tried this syntax:

    using (var scope = _scopeProvider.CreateScope(autoComplete: true)).

    There are no exceptions thrown.

    Have you experiences something like this before? Please can you please give me some advice?

    Thank you, indeed!

  • Salome 5 posts 95 karma points
    Apr 13, 2023 @ 13:35
    Salome
    100

    The issue was caused by another repository which was injected in controller. The repository has been using old code for database access.

Please Sign in or register to post replies

Write your reply to:

Draft