Assert.AreEqual fails while it shouldn't

前端 未结 4 1375
小鲜肉
小鲜肉 2020-12-09 04:33

I have a really weird behavior which I cannot explain.

I have the following class:

public class Project
{
    public virtual int Id { get; set; }

           


        
4条回答
  •  佛祖请我去吃肉
    2020-12-09 05:12

    You are comparing two different objects that hold the same data. You should overload Equals method in your Project class, and implement comparison by id there.

提交回复
热议问题