Skip to content

handler.Original has same values as handler.Entity in GlobalUpdating. #52

@falkartis

Description

@falkartis

I've created a method using this library to control update operations that looks like this:

Triggers<Entity, DbContext>.GlobalUpdating.Add(handler => {
	if (!ChangeAllowed(handler.Original, handler.Entity)) {
		handler.Cancel = true;
	}
});

The problem I get is that both handler.Original and handler.Entity have the new values and my ChangeAllowed method always returns true.

This happens only when I'm passing a new Entity to the Update method from DbSet.
It doesn't happen if I modify a entity queried from the DbSet and then call the Update method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions