Skip to content

Implement TagWith for ExecuteUpdate and DeleteUpdate #28690

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
julielerman opened this issue Aug 12, 2022 · 0 comments
Closed

Implement TagWith for ExecuteUpdate and DeleteUpdate #28690

julielerman opened this issue Aug 12, 2022 · 0 comments

Comments

@julielerman
Copy link

I'm currently using:
EF COre 7.0.0-rc.1.22410.9,
.NET 7.0.100-preview.7.22377.5
Visual Studio Version 17.2.3

TagWith compiles when composed with ExecuteUpdate and DeleteUpdate methods:

context.People.Where(p => p.LastName == "Lehrman").TagWith("BulkUpdate")
    .ExecuteUpdate(s => s.SetProperty(c => c.LastName, c => "Lerman"));

... but doesn't put the comment into the SQL.
Log:

info: 8/12/2022 10:31:32.136 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
      Executed DbCommand (11ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      UPDATE [p]
          SET [p].[LastName] = N'Lerman'
      FROM [People] AS [p]
      WHERE [p].[LastName] = N'Lehrman'
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants