我试图选择2个整数列的列表将结果映射到元组.举个例子:
return connection.Query<Tuple<int,int>>("select id1, id2 from sometable").ToList();
Run Code Online (Sandbox Code Playgroud)
不起作用,但如果我创建一个具有两个整数的类,相同的查询确实有效,例如:
return connection.Query<BogusClass>("select id1, id2 from sometable").ToList();
public class BogusClass{
public int id1 {get;set;}
public int id2 {get;set;}
}
Run Code Online (Sandbox Code Playgroud)
我的偏好不是为了获得一些数据而必须创建一些虚假类.在这种情况下,它是两个整数列,但我还能想到其他用例.
编辑 - 答案:这是HTH的语法
改变:
return connection.Query<Tuple<int,int>>("select id1, id2 from sometable").ToList();
Run Code Online (Sandbox Code Playgroud)
至:
return connection.Query<int, int, Tuple<int, int>>("select id1, id2 from sometable", Tuple.Create, splitOn: "*").ToList();
Run Code Online (Sandbox Code Playgroud) 我在Bootstrap 2.3.1中的模态窗口中使用弹出窗口.问题是popover显示在modal-header div下面.
你可以在这里看到这个问题的一个例子/小提琴:("Launch Demo Modal",然后"Click to toggle popover") http://jsfiddle.net/cZ6Cr/2/
相关代码是:
<a class="btn" data-content="And here's some amazing content. It's very engaging. right? And another thing about this is a that it's really long. When I say long I mean really, really long."
rel="popover"
href="#"
data-original-title="A Title">
Click to toggle popover
</a>
Run Code Online (Sandbox Code Playgroud)
*我在GitHub上修改了cvrebert从这个帖子创建的小提琴 https://github.com/twbs/bootstrap/issues/5014
我一直试图更新嵌套对象,simple_salesforce特别是试图更新对象中的Owner字段Case.
from simple_salesforce import Salesforce
sf = Salesforce(username = 'username',password = 'password',security_token='security_token', sandbox = False)
sf.Case.create({'Description':'stuff in description','Owner':'Owners User'})
Run Code Online (Sandbox Code Playgroud)
每当我尝试插入时,我都会收到以下错误:
回复内容:
[{u'errorCode': u'INVALID_FIELD', u'message': u'The value provided for foreign key reference Owner is not a nested SObject'}]
Run Code Online (Sandbox Code Playgroud)
请任何帮助将不胜感激.