-
Notifications
You must be signed in to change notification settings - Fork 20
Table Hints (SQL Server)
Pawel Gerr edited this page Nov 11, 2025
·
1 revision
var services = new ServiceCollection()
.AddDbContext<DemoDbContext>(builder => builder
.UseSqlServer("conn-string",
options => options.AddTableHintSupport());// starts a database transaction
using var rootTx = myDbContext.Database.BeginTransaction();
var product = myDbContext.Products
.WithTableHints(SqlServerTableHint.RowLock, SqlServerTableHint.UpdLock)
.FirstOrDefaultAsync(p => p.Id == id);- Collection Parameters (temp-tables light)
- Window Functions Support (RowNumber, Sum, Average, Min, Max)
- Nested (virtual) Transactions
- Table Hints
- Queries across multiple databases
- Changing default schema at runtime
- If-Exists / If-Not-Exists checks in migrations
- Isolation of tests [DEPRECATED]