0

I'm developing an ASP.NET website this website is connecting through a dataset to database at the starting of the application I fill the database with the right information then I need to make a request to show the data on the app. For that I'm trying to create a view with the join of many tables. I've already tried this view on SQL Server but now I want to do the same with Linq on my program, but one of my join need two conditions.

1st one: the join between the two table
2nd one: A condition to select the right index

SQL:

dbo.JOBPART AS jp1 
LEFT OUTER JOINdbo.JOBPARAMETER AS p0 ON jp1.JOB_PART_ID = p0.JOB_PART_ID AND p0.PARAM_INDEX = 0 
LEFT OUTER JOIN dbo.JOBPARAMETER AS p1 ON jp1.JOB_PART_ID = p1.JOB_PART_ID AND p1.PARAM_INDEX = 1
var view_JobPart = from jp1 in partTable  
                join p0 in PrmTable on jp1[JOB_PART_FIELD_ID] equals p0[JOB_PARAMETER_FIELD_PART_ID]
                join p1 in PrmTable on jp1[JOB_PART_FIELD_ID] equals p1[JOB_PARAMETER_FIELD_PART_ID]
                select new
                {
                    jp1.JOB_PART_ID,
                    jp1.JOB_MAIN_ID,
                    jp1.PREV_JOB_PART_ID,
                    NEXT_JOB_ID = jp2.JOB_PART_ID,
                    jp1.JOB_ACTION_ID,
                    ja.JOB_ACTION_NAME,

                };
// the parameter index is missing

How can I add this second condition?

Dale K
  • 25,246
  • 15
  • 42
  • 71

0 Answers0