當前位置: 首頁>>代碼示例>>C#>>正文


C# Framework.ForeignKeyConstraint類代碼示例

本文整理匯總了C#中Migrator.Framework.ForeignKeyConstraint的典型用法代碼示例。如果您正苦於以下問題:C# ForeignKeyConstraint類的具體用法?C# ForeignKeyConstraint怎麽用?C# ForeignKeyConstraint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ForeignKeyConstraint類屬於Migrator.Framework命名空間,在下文中一共展示了ForeignKeyConstraint類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddForeignKey

		public override void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
		                                   string[] refColumns, ForeignKeyConstraint constraint)
		{
			GuardAgainstMaximumIdentifierLengthForOracle(name);

			if (ConstraintExists(primaryTable, name))
			{
				Logger.Warn("Constraint {0} already exists", name);
				return;
			}

			primaryTable = QuoteTableNameIfRequired(primaryTable);
			refTable = QuoteTableNameIfRequired(refTable);
			string primaryColumnsSql = String.Join(",", primaryColumns.Select(col => QuoteColumnNameIfRequired(col)).ToArray());
			string refColumnsSql = String.Join(",", refColumns.Select(col => QuoteColumnNameIfRequired(col)).ToArray());

			ExecuteNonQuery(String.Format("ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4})", primaryTable, name, primaryColumnsSql, refTable, refColumnsSql));
		}
開發者ID:rvaccari,項目名稱:Migrator.NET,代碼行數:18,代碼來源:OracleTransformationProvider.cs

示例2: GenerateForeignKey

			GenerateForeignKey(primaryTable, refTable, ForeignKeyConstraint.NoAction);
		}

		public void GenerateForeignKey(string primaryTable, string refTable, ForeignKeyConstraint constraint)
開發者ID:asynchrony,項目名稱:Migrator.NET,代碼行數:4,代碼來源:TransformationProvider.cs

示例3: AddForeignKey

		public virtual void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
                                          string[] refColumns, ForeignKeyConstraint constraint)
		{
			if (ConstraintExists(primaryTable, name))
			{
				Logger.Warn("Constraint {0} already exists", name);
				return;
			}

			string constraintResolved = constraintMapper.SqlForConstraint(constraint);
			ExecuteNonQuery(
				String.Format(
					"ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4}) ON UPDATE {5} ON DELETE {6}",
					primaryTable, name, String.Join(",", primaryColumns),
					refTable, String.Join(",", refColumns), constraintResolved, constraintResolved));
		}
開發者ID:asynchrony,項目名稱:Migrator.NET,代碼行數:16,代碼來源:TransformationProvider.cs

示例4: GenerateForeignKey

		public void GenerateForeignKey(string primaryTable, string refTable, ForeignKeyConstraint constraint)
		{
			// No Op
		}
開發者ID:modulexcite,項目名稱:Migrator.NET,代碼行數:4,代碼來源:NoOpTransformationProvider.cs

示例5: AddForeignKey

		public void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
		                          string[] refColumns, ForeignKeyConstraint constraint)
		{
			// No Op
		}
開發者ID:modulexcite,項目名稱:Migrator.NET,代碼行數:5,代碼來源:NoOpTransformationProvider.cs

示例6: AddForeignKey

		public override void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
		                                   string[] refColumns, ForeignKeyConstraint constraint)
		{
			// NOOP Because SQLite doesn't support foreign keys
		}
開發者ID:rvaccari,項目名稱:Migrator.NET,代碼行數:5,代碼來源:SQLiteTransformationProvider.cs

示例7: GenerateForeignKey

 public void GenerateForeignKey(string foreignTable, string primaryTable, ForeignKeyConstraint constraint)
 {
     _sqlServerTransformationProvider.GenerateForeignKey(foreignTable, primaryTable, constraint);
 }
開發者ID:scottccoates,項目名稱:MigratorNeo4j,代碼行數:4,代碼來源:CliqFlipTransformationProvider.cs

示例8: AddForeignKey

 public void AddForeignKey(string name, string foreignTable, string foreignColumn, string primaryTable, string primaryColumn, ForeignKeyConstraint constraint)
 {
     _sqlServerTransformationProvider.AddForeignKey(name, foreignTable, foreignColumn, primaryTable, primaryColumn, constraint);
 }
開發者ID:scottccoates,項目名稱:MigratorNeo4j,代碼行數:4,代碼來源:CliqFlipTransformationProvider.cs


注:本文中的Migrator.Framework.ForeignKeyConstraint類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。