ASP.NET Core & Web API (50 Qs)•Part 3: Distributed Systems, Kestrel Internals & Scalability (25 - 35)
How do you protect against SQL Injection in .NET?
senior LevelSystem DesignDatabases & SQL
In Simple Words:
- LINQ queries in EF Core are parameterized by default.
- If raw SQL is needed, always use string interpolation with
FromSqlInterpolatedorFromSqlwhich automatically parameterizes variables. Never concatenate strings into raw SQL.