嗨,我在 JSON 结构中的数据是这样的
{
"Imei": 356980051541947,
"sendIds": [
{
"Id": 13014
},
{
"Id": 13190
},
{
"Id": 13419
},
{
"Id": 13422
}
],
"ApplicationVersion": 68,
"GoogleId": "asdsadazxcjkh218",
"ImagesVersion": "123:1"
}
我的课是:
public class PostData
{
public int ApplicationVersion;
public long Imei;
public string GoogleId;
public string FromDate;
public string ToDate;
public string ImagesVersion;
public ItemId[] SendIds;
}
public class ItemId
{
public int Id;
}
C# 代码简洁更新:
const string sql = "UPDATE dbo.SentMessage SET IsDelivered=1 WHERE SendID=@Id";
dapperConn.Execute(sql, postData.SendIds);
但是执行时出现如下错误
必须声明标量变量 \"@Id\
请帮我。