# Preventing SQL injection in C# with Entity Framework

DevFeed: [Preventing SQL injection in C# with Entity Framework](<https://devfeed.tech/articles/preventing-sql-injection-in-c-with-entity-framework-8052.md>)

Original publisher: [Read original article](<https://snyk.io/blog/preventing-sql-injection-entity-framework/>)

Author: Brian Vermeer

Published: 2024-07-30T05:00:00Z

Content type: article

Language: en

Sources: [Blog RSS Feed | Snyk](<https://devfeed.tech/sources/blog-rss-feed-snyk.md>)

Topics: [Vulnerabilities](<https://devfeed.tech/topics/vulnerabilities.md>), [.NET](<https://devfeed.tech/topics/net.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>)

Tags: [awareness](<https://devfeed.tech/tags/awareness.md>), [blog](<https://devfeed.tech/tags/blog.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [code-security](<https://devfeed.tech/tags/code-security.md>), [developer](<https://devfeed.tech/tags/developer.md>), [devrel](<https://devfeed.tech/tags/devrel.md>), [dot-net](<https://devfeed.tech/tags/dot-net.md>), [framework](<https://devfeed.tech/tags/framework.md>), [interest](<https://devfeed.tech/tags/interest.md>), [snyk-code](<https://devfeed.tech/tags/snyk-code.md>), [sql](<https://devfeed.tech/tags/sql.md>), [vulnerabilities](<https://devfeed.tech/tags/vulnerabilities.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>)

## AI overview

The article explains SQL injection risks in C# applications and discusses using parameterized queries and prepared statements instead of string concatenation or escaping.

## Source excerpt

In this blog, we'll discuss strategies to protect your C# code from SQL injection.