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

前端 未结 4 1855
野的像风
野的像风 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:46

    Not sure why you're comparing them as text, but instead of t.user_id == userId use t.userId.Equals(userId, StringComparison.OrdinalIgnoreCase)

提交回复
热议问题