我正在使用以下代码返回一个IList:
```
```
我正在使用以下代码返回一个IList:
```public IList<string> FindCodesByCountry(string country)
{
var query = from q in session.Linq<Store>()
where q.Country == country
orderby q.Code
select new {q.Code};
return (IList<string>) query.ToList();
}
但是我一直遇到这个错误:
无法将类型为'System.Collections.Generic.List<code>1[<>f__AnonymousType01[System.String]]'的对象强制转换为类型'System.Collections.Generic.IList`1[System.String]'。
我应该返回什么?