private IEnumerable <PrimaryKey> GetPrimaryKeys(
            DbContext dbContext,
            MetadataWorkspace metadata,
            Type entityType)
        {
            var tableInfo = metadata.GetTableInfo(entityType);
            var databasePrimaryKeyInfo   = _sqlHelper.GetPrimaryKeyInformation(dbContext, tableInfo.Name);
            var reflectionPrimaryKeyInfo = metadata.GetPrimaryKeys(entityType);
            var primaryKeys = _relationshipMapper.MapPrimaryKeys(databasePrimaryKeyInfo, reflectionPrimaryKeyInfo);

            foreach (var primaryKey in primaryKeys)
            {
                primaryKey.Table = tableInfo;
            }

            return(primaryKeys);
        }