What is the best way to compare two entity framework entities?

Override the Equals method of your object and write an implementation that compares the properties that make it equal.

    public override bool Equals(object obj)
    {
        return MyProperty == ((MyObject)obj).MyProperty
    }

Leave a Comment