Skip to content

WithHint doesn't work with ExecuteUpdate and ExecuteDelete methods #832

@Vijay-Nirmal

Description

@Vijay-Nirmal

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions