Show / Hide Table of Contents

    Class ForeignKeySchemaCollection

    List of foreign keys for table TableSchema.

    Inheritance
    System.Object
    System.Collections.ObjectModel.Collection<ForeignKeySchema>
    System.Collections.ObjectModel.KeyedCollection<System.String, ForeignKeySchema>
    ForeignKeySchemaCollection
    Namespace: Kros.Data.Schema
    Assembly: Kros.Utils.dll
    Syntax
    public class ForeignKeySchemaCollection : KeyedCollection<string, ForeignKeySchema>, IList<ForeignKeySchema>, ICollection<ForeignKeySchema>, IList, ICollection, IReadOnlyList<ForeignKeySchema>, IReadOnlyCollection<ForeignKeySchema>, IEnumerable<ForeignKeySchema>, IEnumerable
    Remarks

    To the foreign keys added to this list is automatically set their Table. Foreign key can belong only to one table.

    Constructors

    ForeignKeySchemaCollection(TableSchema)

    Creates a new foreign key list for table.

    Declaration
    public ForeignKeySchemaCollection(TableSchema table)
    Parameters
    Type Name Description
    TableSchema table

    Table to which foreign key list belongs.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Value of table is null.

    Methods

    Add(String, String, IEnumerable<String>, String, IEnumerable<String>)

    Creates a definition of foreign key with the name and adds it to the list. Columns primaryKeyTableColumns in parent table primaryKeyTableName are referenced in columns foreignKeyTableColumns of child table foreignKeyTableName.

    Declaration
    public ForeignKeySchema Add(string name, string primaryKeyTableName, IEnumerable<string> primaryKeyTableColumns, string foreignKeyTableName, IEnumerable<string> foreignKeyTableColumns)
    Parameters
    Type Name Description
    System.String name

    Name of the foreign key.

    System.String primaryKeyTableName

    .

    System.Collections.Generic.IEnumerable<System.String> primaryKeyTableColumns

    List of columns in parent table.

    System.String foreignKeyTableName

    .

    System.Collections.Generic.IEnumerable<System.String> foreignKeyTableColumns

    List of columns in child table.

    Returns
    Type Description
    ForeignKeySchema
    Exceptions
    Type Condition
    System.ArgumentNullException

    Value of any argument is null.

    System.ArgumentException

    Add(String, String, String, String, String)

    Creates a definition of foreign key with the name and adds it to the list. Column primaryKeyTableColumn in parent table primaryKeyTableName is referenced in column foreignKeyTableColumn of child table foreignKeyTableName.

    Declaration
    public ForeignKeySchema Add(string name, string primaryKeyTableName, string primaryKeyTableColumn, string foreignKeyTableName, string foreignKeyTableColumn)
    Parameters
    Type Name Description
    System.String name

    Name of the foreign key.

    System.String primaryKeyTableName

    .

    System.String primaryKeyTableColumn

    Column name in primary key table.

    System.String foreignKeyTableName

    .

    System.String foreignKeyTableColumn

    Column name in foreign key table.

    Returns
    Type Description
    ForeignKeySchema

    Created foreign key.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Value of any parameter is null.

    System.ArgumentException

    Value of any parameter is empty string, or string containing only whitespace characters.

    GetKeyForItem(ForeignKeySchema)

    Declaration
    protected override string GetKeyForItem(ForeignKeySchema item)
    Parameters
    Type Name Description
    ForeignKeySchema item
    Returns
    Type Description
    System.String
    Overrides
    System.Collections.ObjectModel.KeyedCollection<System.String, Kros.Data.Schema.ForeignKeySchema>.GetKeyForItem(Kros.Data.Schema.ForeignKeySchema)

    InsertItem(Int32, ForeignKeySchema)

    Declaration
    protected override void InsertItem(int index, ForeignKeySchema item)
    Parameters
    Type Name Description
    System.Int32 index
    ForeignKeySchema item
    Overrides
    System.Collections.ObjectModel.KeyedCollection<System.String, Kros.Data.Schema.ForeignKeySchema>.InsertItem(System.Int32, Kros.Data.Schema.ForeignKeySchema)

    RemoveItem(Int32)

    Declaration
    protected override void RemoveItem(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Overrides
    System.Collections.ObjectModel.KeyedCollection<System.String, Kros.Data.Schema.ForeignKeySchema>.RemoveItem(System.Int32)
    Back to top KROS a.s.