/// <summary><see cref="Edrych.DataAccess.DataAccessBase.GetKeys"/></summary> public override List<Key> GetKeys(string TableName) { this.ClearParameters(); this.AddTableParams(TableName); List<Key> keys = GetDbItems<Key>(DataAccessResources.ANSI_FindKeys, (reader) => { Key myKey = new Key(); myKey.Name = reader["CONSTRAINT_NAME"].ToString(); int myType = (int)reader["KeyType"]; myKey.Type = myType == 1 ? KeyType.Primary : myType == 2 ? KeyType.Foreign : KeyType.None; return myKey; }); return keys; }
/// <summary><see cref="Edrych.DataAccess.DataAccessBase.GetKeys"/></summary> public override List<Key> GetKeys(string TableName) { List<Key> keys = new List<Key>(); if (AddTableParameters(TableName)) { keys = GetDbItems<Key>(DataAccessResources.DB2_FindKeys, (reader) => { Key myKey = new Key(); myKey.Name = reader["CONSTNAME"].ToString(); int myType = (int)reader["KeyType"]; myKey.Type = myType == 1 ? KeyType.Primary : myType == 2 ? KeyType.Foreign : KeyType.None; return myKey; }); } return keys; }