次のコードを使用して 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();
}
ただし、このエラーが発生し続けます:
1[<>f__AnonymousType0
タイプ 'System.Collections.Generic.List 1[System.String]]' のオブジェクトをタイプ 'System.Collections.Generic.IList`1[System.String]'にキャストできません。
私はここに何を返すことになっていますか?