In .NET land that's handled by EF Core 9 using the EF.Constant(...) and EF.Parameter(...) wrappers that either (safely!) inline the value or force parameterisation.
https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-cor...