令我惊讶的是它没有工作!!我在代码中使用了linqtextquerybuilder
,但我很困惑。这是我的代码,但我不知道如何修复错误:
var source = file.AsQueryable();
LinqTextQueryBuilder queryBuilder = new LinqTextQueryBuilder();
queryBuilder.SetSource(source);
string queryText = @"from f in source select new { f.Authors, f.EnglishTitle, f.journal }";
var result = queryBuilder.Query(queryText); //but this query itsself worked!!
var result2 = from f in source select new { f.Authors, f.EnglishTitle, f.journal };
我在var result = queryBuilder.Query(queryText);
对象引用未设置为对象的实例
问题是什么?