Exemple #1
0
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        protected override RelationalTypeMapping GetTypeMapping(ColumnModel column)
        {
            RelationalTypeMapping mapping = null;

            if (column.DataType != null)
            {
                string underlyingDataType = null;
                column.Table.Database.SqlServer().TypeAliases?.TryGetValue(
                    SqlServerDatabaseModelFactory.SchemaQualifiedKey(column.DataType, column.SqlServer().DataTypeSchemaName), out underlyingDataType);

                mapping = TypeMapper.FindMapping(underlyingDataType ?? column.DataType);
            }

            return(mapping);
        }
Exemple #2
0
 private static bool HasTypeAlias(ColumnModel column)
 => column.DataType != null &&
 column.Table.Database.SqlServer().TypeAliases?.ContainsKey(
     SqlServerDatabaseModelFactory.SchemaQualifiedKey(column.DataType, column.SqlServer().DataTypeSchemaName)) == true;