コード例 #1
0
        public override async Task <IEnumerable <IConnectionDataType> > GetDataTypes(ExecutionContext executionContext, Guid providerDefinitionId, string containerId)
        {
            try
            {
                var config = await base.GetAuthenticationDetails(executionContext, providerDefinitionId);

                var tables = await _client.GetTableColumns(config.Authentication, containerId);

                var result = from DataRow row in tables.Rows
                             let name = row["COLUMN_NAME"] as string
                                        let rawType                       = row["DATA_TYPE"] as string
                                                                 let type = GetVocabType(rawType)
                                                                            select new SqlServerConnectorDataType
                {
                    Name        = name,
                    RawDataType = rawType,
                    Type        = type
                };

                return(result.ToList());
            }
            catch (Exception e)
            {
                var message = $"Could not get Data types for Container '{containerId}' for Connector {providerDefinitionId}";
                _logger.LogError(e, message);
                throw new GetDataTypesException(message);
            }
        }