public override bool Equals(object obj) { var other = obj as InstanceRestriction; return other?._expression == _expression && other._instance == _instance; }