private void AssertDependencyValidity(DataDependency <TContents> item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } if (item.Dependant != null) { throw new ArgumentException("Stack dependency was already added to another node."); } if (item.Any(n => n.Node.ParentGraph != _owner.ParentGraph)) { throw new ArgumentException("Dependency contains data sources from another graph."); } }