我从博客 scottgu 研究 Linq to sql 并收到错误消息:
“无法解析符号 ExecuteMethodCall”。
linq to sql支持Method ExecuteMethodCallis,但是为什么会出现这个错误呢?
ALTER PROCEDURE dbo.VariableShapeSample
(
@shape int
)
AS
if(@shape=1)
select * from products
else if (@shape=2)
select * from orders
public partial class NorthwindDataContext
{
[Function(Name = "VariableShapeSample")]
[ResultType(typeof (Product))]
[ResultType(typeof (Order))]
public IMultipleResults VariableShapeSample(System.Nullable<int> shape )
{
IExecuteResult result = this.ExecuteMethodCall(this
, ((MethodInfo) (MethodInfo.GetCurrentMethod()))
, shape);
return (IMultipleResults) result.ReturnValue;
}
}