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.