Skip to content

Impossible to bind a hook to a specific type of DbContext #1508

@DmitriyIlchenko-1

Description

@DmitriyIlchenko-1

Describe the bug
There's a db hook feature that lets you create a hook that gets called only for a specific type of DbContext. The problem is that I've gone through the implementation and found no logic that would handle that. I created a dummy hook and bind it to a dummy db context and the hook is still called even when I use SmartDbContext.

To Reproduce
Steps to reproduce the behavior:

  1. Try creating a hook and bind it to any db context type but SmartDbContext.
  2. The result is that the hook will still be called even when SmartDbContext is used.

Expected behavior
The excepted behavior is the hook gets skipped unless the db context type in the db hook's metadata matches the current db context whose the SaveChanges() method has been called.

Screenshots

Desktop (please complete the following information):
It don't matter

Additional context

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions