コード例 #1
0
 public static void AddForeignKey(this IQuery query, ObjectName tableName, string constraintName, string[] columnNames,
                                  ObjectName foreignTableName, string[] foreignColumns, ForeignKeyAction onDelete, ForeignKeyAction onUpdate)
 {
     query.AddConstraint(tableName,
                         SqlTableConstraint.ForeignKey(constraintName, columnNames, foreignTableName.FullName, foreignColumns, onDelete,
                                                       onUpdate));
 }
コード例 #2
0
        private void RunQuery(object sender, System.Windows.RoutedEventArgs e)
        {
            IQuery query = NewQuery();

            query.AddConstraint("_firstName", FirstName.Text);
            query.AddConstraint("_lastName", LastName.Text);

            IObjectSet enumerable = query.Execute();

            foreach (Person person in enumerable)
            {
                System.Diagnostics.Debug.WriteLine(person.FirstName + " " + person.LastName);
            }

            People.ItemsSource = enumerable;
        }
コード例 #3
0
 public static void AddUniqueKey(this IQuery query, ObjectName tableName, string constraintName, params string[] columnNames)
 {
     query.AddConstraint(tableName, SqlTableConstraint.UniqueKey(constraintName, columnNames));
 }
コード例 #4
0
 public static void AddCheck(this IQuery query, ObjectName tableName, string constraintName, SqlExpression checkExpression)
 {
     query.AddConstraint(tableName, SqlTableConstraint.Check(constraintName, checkExpression));
 }