什么时候调用此Linq函数?

时间:2019-06-20 20:43:29

标签: asp.net

我试图了解这段代码的工作原理,但这是我第一次看到这段代码。存储的过程被调用一次还是两次,每个数据绑定一次?

在第一次分析时,我看到它显示result.ReturnValue的位置,这似乎是存储的过程的结果,但不确定。

<Global.System.Data.Linq.Mapping.FunctionAttribute(Name:="dbo.sp_VhosCogs_Results")>
Public Function sp_VhosCogs_Results(<Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="ProspectID", DbType:="NVarChar(50)")> ByVal prospectID As String, <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="SetPoint", DbType:="NVarChar(10)")> ByVal setPoint As String, <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="Ancilliary_bundled", DbType:="Bit")> ByVal ancilliary_bundled As System.Nullable(Of Boolean), <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="LineLoss_Rate", DbType:="Bit")> ByVal lineLoss_Rate As System.Nullable(Of Boolean), <Global.System.Data.Linq.Mapping.ParameterAttribute(Name:="ProdType", DbType:="NVarChar(50)")> ByVal prodType As String) As ISingleResult(Of sp_VhosCogs_ResultsResult)
    Dim result As IExecuteResult = Me.ExecuteMethodCall(Me, CType(MethodInfo.GetCurrentMethod,MethodInfo), prospectID, setPoint, ancilliary_bundled, lineLoss_Rate, prodType)
    Return CType(result.ReturnValue,ISingleResult(Of sp_VhosCogs_ResultsResult))
End Function

Dim query = dbProspectView.sp_VhosCogs_Results(Request.QueryString("ContractID"),
GridView.DataSource = query
GridView1.DataBind()
GridView2.DataSource = query
GridView2.DataBind()

0 个答案:

没有答案