Does PetaPoco's Query(string query, parameters) method protect from SQL injection?

Viewed 1667

In PetaPoco's home page there is a mention that PetaPoco's SQL Builder (Sql object) protects from SQL injection. But does Query(string query, parameters) method protect from SQL injection?

SQL Builder is safe:

var id = 123;
var a = db.Query<article>(PetaPoco.Sql.Builder
  .Append("SELECT * FROM articles")
  .Append("WHERE article_id=@0", id)
);

But is it safe with string query where parameters are passed like this?

var id = 123;
var a = db.Query<article>("SELECT * FROM articles WHERE article_id=@0", id);
1 Answers
Related