Skip to content

Instantly share code, notes, and snippets.

@kmoormann
Created April 24, 2014 02:53
Show Gist options
  • Save kmoormann/11239862 to your computer and use it in GitHub Desktop.
Save kmoormann/11239862 to your computer and use it in GitHub Desktop.
Equals method override snippet
public override bool Equals(object obj)
{
return this.Equals(obj as IAggregate);
}
public virtual bool Equals(IAggregate other)
{
return null != other && other.Id == this.Id;
}
//from: https://github.com/joliver/CommonDomain/blob/master/src/proj/CommonDomain.Core/AggregateBase.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment