How do I perform a case-insensitive compare of GUIDs with LINQ?

前端 未结 4 1845
野的像风
野的像风 2021-01-04 02:49

In the code below, I want to compare two GUIDs. The problem is I don\'t get any tasks returned because the GUIDS are different case (uppercase vs. lowercase). I need to perf

4条回答
  •  日久生厌
    2021-01-04 03:48

    I always had a dillema of using == for guid/uniqueidentifier columns comparison in linq statements (especially in where clause) so I took a rather safe route of using - (entityGuidColumn.CompareTo(guidParameter)==0) . This worked for me. Give it a shot.

提交回复
热议问题