(该法典正在C#中使用Dapper Dot Net)
该法典规定:
var command = "UPDATE account SET priority_id = @Priority WHERE name = @Name";
connection_.Execute(command, new { Name = "myname", Priority = 10 } );
该法典载有一项SqlException:
class MyAccount
{
public string Name;
public int Priority;
}
var command = "UPDATE account SET priority_id = @Priority WHERE name = @Name";
var acct = new MyAccount { Name = "helloworld", Priority = 10 };
connection_.Execute(command, acct);
系统.Data.SqlClient.SqlException: 不得不宣布微量变量“@Priority”。
为什么?