我有以下代码用于编译的Linq2sql查询以计算表中的行数。尽管相同的未编译查询运行顺利,但查询抛出异常:publicstaticFuncCompiledCount=CompiledQuery.Compile((ServiceCustomContextdb)=>db.Current.Count());publicstaticintCount(){using(ServiceCustomContextdb=newServiceCustomContext(Constants.NewSqlConnection))returnCompiledCount(db);}ServiceCustomCon