EntityFramework-Plus icon indicating copy to clipboard operation
EntityFramework-Plus copied to clipboard

WithHint doesn't work with ExecuteUpdate and ExecuteDelete methods

Open Vijay-Nirmal opened this issue 4 months ago • 1 comments

WithHint doesn't work with EF 7+ ExecuteUpdate and ExecuteDelete methods

await context.TableName.WithHint(SqlServerTableHintFlags.ROWLOCK, typeof(TableName))
                       .Where(x => x.Id = 1)
                       .ExecuteUpdateAsync(x => x.SetProperty(y => y.Name, "User"));

Expected

UPDATE [b]
SET [b].[Name] = N'User'
FROM [TableName] as [b] WITH (ROWLOCK)
WHERE [b].[Id] =1

Actual

UPDATE [b]
SET [b].[Name] = N'User'
FROM [TableName] as [b]
WHERE [b].[Id] =1

Vijay-Nirmal avatar Aug 28 '25 15:08 Vijay-Nirmal

Hello @Vijay-Nirmal

Thank you for reporting this. My developer already proposed a solution, but unfortunately I’ll only be able to review it with him in two weeks as I’m currently on vacation.

Best Regards,

Jon

JonathanMagnan avatar Sep 01 '25 13:09 JonathanMagnan