Closed JarRami closed 1 year ago
If I have a table like
public class NullableHolder { [Key] public int ID { get; set; } public int? Value { get; set; } }
And I create Insert and Update triggers like (take note of the comparisons)
modelBuilder.Entity<NullableHolder>() .AfterInsert(trigger => trigger .Action(action => action .Condition(nh => nh.Value != null) ) ) .AfterUpdate(trigger => trigger .Action(action => action .Condition((before, after) => (before.Value != null) && (after.Value == null)) ) );
After running Add-Migration I get the following triggers
CREATE TRIGGER LC_TRIGGER_AFTER_INSERT_NULLABLEHOLDER -- IF (@NewValue IS NULL)
and
CREATE TRIGGER LC_TRIGGER_AFTER_UPDATE_NULLABLEHOLDER -- IF (@OldValue IS NULL AND @NewValue IS NULL)
Two of the created IS NULLs seem to be incorrect when it's created even when the actual comparison was .Value != null?
Unfortunately, I'm not able to run .NET6 so this behaviour is seen against library version 5.3.6.
Fixed in https://github.com/win7user10/Laraue.EfCoreTriggers/issues/71
This seems to work, thankyou
If I have a table like
And I create Insert and Update triggers like (take note of the comparisons)
After running Add-Migration I get the following triggers
and
Two of the created IS NULLs seem to be incorrect when it's created even when the actual comparison was .Value != null?
Unfortunately, I'm not able to run .NET6 so this behaviour is seen against library version 5.3.6.