EntityFramework ExecuteSqlCommand not accepting parameter

2

I'm running the ExecuteSqlCommand.

With the correct mode, with parameter does not work:

var SQL = "update POSTOFFICE set Status = 1 where name = '@url'";
dbMailEnable.Database.ExecuteSqlCommand(SQL, new SqlParameter("@url", EP.Cliente.Url.Trim().ToLower()));

No parameter works!

var SQL = "update POSTOFFICE set Status = 1 where name = '" + EP.Cliente.Url.Trim().ToLower() + "'";
dbMailEnable.Database.ExecuteSqlCommand(SQL);

But no parameter is not recommended, SQL injection, etc. alias in Visual Studio help nor was it possible to do so.

What to do?

NOTE: I am having to use this command because the database is third-party and does not have a primary key so I could not do it via Model.

    
asked by anonymous 25.02.2016 / 20:43