public ResultCode AddDependency(AssetGraphNode dependency) { var added = Dependencies.AddOrUpdate(dependency.SourcePath, dependency, (x, oldValue) => { ToolDebug.Assert(oldValue == dependency); return(oldValue); }); if (added != dependency) { return(new ResultCode(ResultCode.SUCCESS_FALSE)); } dependency.References.AddOrUpdate(SourcePath, this, (x, oldValue) => { ToolDebug.Assert(oldValue == this); return(this); }); return(new ResultCode(ResultCode.SUCCESS)); }