sql server - Linq query fetches different value than sql query view -


i have created view in sql server joining 3 tables , using entity framework , accessing in application.

i have following code value 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 , added

    [key, column(order = 0)]     public long tapstartstopdataid { get; set; }  

as key value. still, don't proper result when execute application.

finally, found solution used row_number() on (order id) rownum, create new column , gave key.i deleted edmx diagram , added again new column populate there , got desired result


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -