我有一个$ scope对象,如下所示
$scope.array=[{"ID":"1","ID":"2","ID":"3"}];
我想要做的是将这些值传递给以下SQL查询
Select * from table where ID in("Here I need the above 3 values one after another")
我该怎么做?
答案 0 :(得分:1)
创建一个类
public class myId {
public int ID {set;get;}
}
将其传递给web api
public void submitID(List<myId> ids){
// do rest of the things
var id = string.Join(",", ids.Select(x => x.ID).ToArray());
var query="Select * from table where ID in('"+id+"')";
}