Lambda Expression: == vs. .Equals()

前端 未结 6 780
名媛妹妹
名媛妹妹 2021-01-07 23:09

This is a purely academic question, but what\'s the difference between using == and .Equals within a lambda expression and which one is preferred?

Code exam

6条回答
  •  走了就别回头了
    2021-01-07 23:23

    This is a duplicate of

    C# difference between == and Equals()

    For some additional thoughts on different kinds of equality and how none of them do what you really want, see

    http://blogs.msdn.com/ericlippert/archive/2009/04/09/double-your-dispatch-double-your-fun.aspx

提交回复
热议问题