/// <summary> /// Check if another Db object have same DB name /// </summary> /// <param name="trigger">Another DB object</param> /// <returns>True - objects have same names</returns> public bool IsSameDbName(DbObjectViewSchema trigger) { if (trigger == null) { throw new ArgumentNullException(nameof(trigger)); } return(IsSameDbName(trigger.DbSchemaName, trigger.Name)); }
/// <summary> /// Compares database views if schematicly match each other /// </summary> /// <param name="masterObjectView">Master database objectView (or left)</param> /// <param name="checkedObjectView">Checked database objectView (or right)</param> /// <returns>Comparison result</returns> public static DbSchemaCompareResult DbCompare(DbObjectViewSchema masterObjectView, DbObjectViewSchema checkedObjectView) { if (checkedObjectView == null) { throw new ArgumentNullException(nameof(checkedObjectView)); } DbSchemaCompareResult result = new DbSchemaCompareResult(masterObjectView, checkedObjectView); result.CompareResultType = DbSchemaCompareResultType.Equals; foreach (DbSchemaCompareResult fColumnCompare in result.InnerResults) { if (fColumnCompare.CompareResultType != DbSchemaCompareResultType.Equals) { fColumnCompare.CompareResultType = DbSchemaCompareResultType.Different; } } return(result); }