0

I have created a view in SQL server by joining 3 tables and using Entity Framework and accessing it in my application.

I have the following code to get the value from view table.

 tapDataContext.TapTimeSheetViews.
Where(timesheet=>timesheet.UserId==userId && timesheet.WorkDate==dates);

this fetches duplicate values. But, sql query gives proper values.

I had referred this link here and added

    [Key, Column(Order = 0)]
    public long TapStartStopDataId { get; set; } 

as key value. But still, I don't get proper result when I execute my application.

Community
  • 1
  • 1
Shiva Prasad
  • 66
  • 1
  • 9

1 Answers1

0

Finally, i found the solution I used row_number() over (order by Id) as rownum, to create a new column and gave that as key.I deleted my EDMX diagram and added again so new column will populate there and i got the desired result

Shiva Prasad
  • 66
  • 1
  • 9