LINQ select on a SQL View gets wrong answer

后端 未结 7 1395
猫巷女王i
猫巷女王i 2021-01-05 02:07

I have a SQL View that produces a response with 8 columns. Its a rather complicated so I won\'t list it here and it won\'t add much to the issue I\'m trying to understand.

7条回答
  •  青春惊慌失措
    2021-01-05 02:56

    Actually the questions from @stanke gave me an idea.

    I actually altered the view slightly to include another column so that each record could be identified uniquely.

    I don't actually need the columns value in my resulting table but it did help LINQ keep the records unique when querying. It appears that SQL does this just fine on its own but LINQ needed a bit of a helping hand to keep the records distinct.

    It now works as expected in both SQL and LINQ

提交回复
热议问题