Skip to content

Commit

Permalink
Solution for "OnDeleteTransactor has no effect when context is...
Browse files Browse the repository at this point in the history
...obtained with DbProxy.GetContext".

Starcounter#23
  • Loading branch information
eriksunsol committed Nov 9, 2020
1 parent 52c5980 commit 3d8997e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Starcounter.Database.Extensions/OnDeleteTransactor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ public override void Delete(object obj)
}
}

public static IDatabaseContext GetContext(object proxy)
{
IDatabaseContext db = DbProxy.GetContext(proxy);

return new OnDeleteContext(db);
}

public OnDeleteTransactor(ITransactor transactor) : base(transactor) { }

protected override IDatabaseContext EnterDatabaseContext(object transactorContext, IDatabaseContext db) => new OnDeleteContext(db);
Expand Down

0 comments on commit 3d8997e

Please sign in to comment.