Last active
June 8, 2026 14:10
-
-
Save mirmostafa/04361c074ec397ebc3476bee21ce4a3a to your computer and use it in GitHub Desktop.
From SQL Interpolated String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dbResult = await this._readDbContext.ProductCategories.FromSqlInterpolated($@" | |
| SELECT TOP 1 * | |
| FROM [biz].[ProductCategories] t | |
| WHERE NOT EXISTS (SELECT 1 | |
| FROM [biz].[ProductCategories] | |
| WHERE ParentProductCategoryId = t.ProductCategoryId) | |
| AND t.ProductCategoryId = {parameters.CategoryId} AND MerchantId = {merchantId}") | |
| .AsNoTracking().FirstOrDefaultAsync(); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As SQL parameter