public bool CanCreate(IRow prevRow, IEnumerable <string> prevUniqueKeys) { if (UniqueKeys.Count() == 0 && IsRootRow) { return(true); } foreach (var column in UniqueKeys) { if (this[column] == DBNull.Value) { return(false); } } if (prevRow == null) { return(true); } if (UniqueKeys.Count() == 0) { return(true); } foreach (var column in prevUniqueKeys.Merge(UniqueKeys)) { if (this[column] == DBNull.Value && prevRow[column] == DBNull.Value) { continue; } if (this[column] == DBNull.Value && prevRow[column] != DBNull.Value) { return(true); } if (this[column] != DBNull.Value && prevRow[column] == DBNull.Value) { return(true); } if (this[column].ToString() != prevRow[column].ToString()) { return(true); } } return(false); }