如何返回以下类中的名字和姓氏?在静态类中返回多个值
public static string GetAccount(int AccountId)
{
LinqSqlDataContext contextLoad = new LinqSqlDataContext();
var q = (from p in contextLoad.MyAccounts
where p.AccountId == AccountId
select new { Name = p.FirstName, Surname = p.Surname }).Single();
return ??;
}
假设你想要的返回类型也是正确的,你不只是想返回string.Format(“{0} {1}”,q.Name,q.Surname);' – 2012-07-26 11:50:36