Skip to main content
InterviewHubPRO
Section Overview
Q28

Question 28 of 50

Part 3: Distributed Systems, Kestrel Internals & Scalability (25 - 35)

56%
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 FromSqlInterpolated or FromSql which automatically parameterizes variables. Never concatenate strings into raw SQL.