Click here to Skip to main content
15,878,230 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to write a Linq method that will allow me to pass in parameters.
In the following example, I am accessing a stored procedure. I will then call this method on the client side.
Public Function GetContractData(ByVal contract As String) As IQueryable(Of bdis_ContractSearch2_Result)
        Return Me.ObjectContext.GetContractData.where(Function (cntr)=> cntr.contract).[Select](Function(cntr) New _
                                            APP07_20_2010.Web.DataEntities() with{ _
                      .Contract = cntr.Contract,_
                      .ContractDesc = cntr.ContractDesc, _
                      .ClientName = cntr.ClientName, _
                      .ProjMgrName = cntr.ProjMgrName, _
                      .Status = cntr.Status, _
                      .EndDate = cntr.EndDate, _

Can someone help me correctly format this method?
Updated 29-Jul-10 19:19pm

1 solution

When you are using a stored procedure it will act as local scope.
So I think , it is better to fill a table when calling the store procedure.And query that table using linq.

The return type must be that class type
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900