Skip to content

Commit

Permalink
NET-901 S2077: update repro to remove FN
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianAmbrosini authored and sonartech committed Dec 20, 2024
1 parent 482401d commit 06cb138
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void ConcatAndFormat(DbContext context, string query, params object[] par

public void Foo(BloggingContext context, string query)
{
var b = context.Blogs.FromSql($"{query}"); // Compliant - FN, See: https://github.com/SonarSource/sonar-dotnet/issues/5636
var b = context.Blogs.FromSql($"{query}"); // Compliant: interpolated strings are safe in EF (https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.relationalqueryableextensions.fromsql?view=efcore-2.0#microsoft-entityframeworkcore-relationalqueryableextensions-fromsql-1(system-linq-iqueryable((-0))-system-formattablestring))
}
}

Expand Down

0 comments on commit 06cb138

Please sign in to comment.