EntityFramework-Plus
EntityFramework-Plus copied to clipboard
WithHint doesn't work with ExecuteUpdate and ExecuteDelete methods
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
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