private async Task <List <MetadataOracleTypePropertyDefinition> > ExecuteReaderAndLoadTypeDefinitionAsync(DbCommand cmd) { var reader = await cmd.ExecuteReaderAsync(); var properties = new List <MetadataOracleTypePropertyDefinition>(); while (await reader.ReadAsync()) { if (await reader.IsDBNullAsync(2)) { var property = new MetadataOracleTypePropertyDefinition { Order = reader.GetInt32(0), Name = reader.GetString(1)?.ToUpper() }; properties.Add(property); } else { var property = new MetadataOracleTypeSubTypeDefinition { Order = reader.GetInt32(0), Name = reader.GetString(1)?.ToUpper() }; if (reader.GetString(4) == COLLECTION) { property.MetadataOracleType = await GetOrCreateOracleTypeMetadataAsync(cmd.Connection, await GetOracleCollectionUnderlyingTypeAsync(cmd.Connection, reader.GetString(2), reader.GetString(3))).ConfigureAwait(false); } else { property.MetadataOracleType = await GetOrCreateOracleTypeMetadataAsync(cmd.Connection, new OracleUdtInfo(reader.GetString(2), reader.GetString(3))).ConfigureAwait(false); } properties.Add(property); } } return(properties); }
private List <MetadataOracleTypePropertyDefinition> ExecuteReaderAndLoadTypeDefinition(DbCommand cmd) { var reader = cmd.ExecuteReader(); var properties = new List <MetadataOracleTypePropertyDefinition>(); while (reader.Read()) { if (reader.IsDBNull(2)) { var property = new MetadataOracleTypePropertyDefinition { Order = reader.GetInt32(0), Name = reader.GetString(1)?.ToUpper() }; properties.Add(property); } else { var property = new MetadataOracleTypeSubTypeDefinition { Order = reader.GetInt32(0), Name = reader.GetString(1)?.ToUpper() }; if (reader.GetString(4) == COLLECTION) { property.MetadataOracleType = GetOrCreateOracleTypeMetadata(cmd.Connection, GetOracleCollectionUnderlyingType(cmd.Connection, reader.GetString(2), reader.GetString(3))); } else { property.MetadataOracleType = GetOrCreateOracleTypeMetadata(cmd.Connection, new OracleUdtInfo(reader.GetString(2), reader.GetString(3))); } properties.Add(property); } } return(properties); }
private MetadataOracleNetTypeDefinition GetPropertyMetadata(Type propertyType, MetadataOracleTypeSubTypeDefinition propertyObject, bool fuzzyNameMatch) { if (propertyType.IsCollection()) { return(new MetadataOracleNetTypeDefinition( Cache, propertyType.GetCollectionUnderType(), propertyObject.MetadataOracleType, Cache.PresetGetValueOrDefault(propertyType.GetCollectionUnderType()).Props, fuzzyNameMatch)); } else { return(new MetadataOracleNetTypeDefinition( Cache, propertyType, propertyObject.MetadataOracleType, Cache.PresetGetValueOrDefault(propertyType).Props, fuzzyNameMatch)); } }