Open jeremysimmons opened 3 years ago
@jeremysimmons To clarify, are you saying that the trigger as currently defined does not work with some EF Core scenario? If so, can you provide more details?
Or are you saying that the trigger would be more robust when used with non-EF Core scenario if implemented in the way you show?
@ajcvickers sorry I didn't see this before.
are you saying that the trigger as currently defined does not work with some EF Core scenario
yes, the core scenario it doesn't work for is all rows in a multi-row insert.
can you provide more details
INSERT INTO table_name (column_list)
VALUES
(value_list_1),
(value_list_2),
...
(value_list_n);
I suppose this isn't an issue if you're using the DbSet
are you saying that the trigger would be more robust when used with non-EF Core scenario if implemented in the way you show
Yes. Suggestion is to offer a code example that works for the database holistically (my example), or at least add a disclaimer that it won't work for multi-row inserts.
The example
CREATE TRIGGER [dbo].[Blogs_UPDATE] ON [dbo].[Blogs]
only deals with a single row. It does not work with all rows in the virtual INSERTED tableSomething like this will work for ALL updated rows.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.