我正在为 ORMLite 评估 T4。不管有几个小故障,我都让它工作了。当我在 MSSQL 中将 web.config 指向 Northwind 并从我的 SS Web 项目中运行它时,OrmLite.SP.cs 会自动生成以下内容:
public class OrmLiteSPStatement
{
....
try
{
reader = command.ExecuteReader();
#pragma warning disable 618
return reader.GetFirstColumn<T>();
#pragma warning restore 618
}
finally ...
try
{
reader = command.ExecuteReader();
#pragma warning disable 618
return reader.GetScalar<T>();
#pragma warning restore 618
}
finally ...
try
{
reader = command.ExecuteReader();
#pragma warning disable 618
return reader.GetFirstColumn<T>();
#pragma warning restore 618
}
finally ...
try
{
reader = command.ExecuteReader();
#pragma warning disable 618
return reader.GetFirstColumnDistinct<T>();
#pragma warning restore 618
}
finally ...
它们都来自 OrmLiteSPStatement 类中的 OrmLite.SP.cs 自动生成代码...
Error 1 No overload for method 'GetFirstColumn' takes 0 arguments
Error 2 No overload for method 'GetScalar' takes 0 arguments
Error 3 No overload for method 'GetFirstColumn' takes 0 arguments
Error 4 No overload for method 'GetFirstColumnDistinct' takes 0 arguments
当我将鼠标移到检查错误时,visual studio 说:
Cannot access internal method 'GetFirstColumn' here
我如何解决它?
我正在运行 VS2012、.Net 4.0、ServiceStack 3.9.38.0、SQL2008R2