我如何将Id,FirstName字段取出?
public IList<Object[]> SelectObject()
{
return Session.CreateQuery("select c.Id, c.FirstName from Customer c").List<Object[]>();
}
[Test]
public void GetSelectObject()
{
var cust = _simple.SelectObject();
Assert.AreEqual(6, cust.Count);
string s = "";
foreach(object obj in cust)
{
s = s + ..............//我如何将Id,FirstName字段取出?
}
Assert.AreEqual("1李2李3张4张5张6张", s);
}
foreach(object[] obj in cust)
{var id=obj[0];var FirstName=obj[1];
s = s + ..............//我如何将Id,FirstName字段取出?
}