我正在从事一个项目,我正在从现有系统中逐步淘汰实体框架。
我有
public List<GSP> GetOwnAirline()
{
var res = from own in entity.GSP where own.Description == "Own Airline" select own;
return res.ToList();
}
为了绕过这个我做了
public List<GSP> GetOwnAirline()
{
string get_ = "SELECT * FROM " + Adm.schema_ + "Adm.GSP WHERE Description = 'Own Airline'";
ccs = new SqlConnection(Adm.COnnectionString);
//convey transaction to db
cmd = ccs.CreateCommand();
ccs.Open();
cmd.CommandText = get_;
var res =cmd.ExecuteScalar();
ccs.Close();
return res.ToList();
}
但是.ToList 在这种情况下似乎没有被识别。我哪里做错了伙计们?