/// <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 virtual TypeScaffoldingInfo GetTypeScaffoldingInfo([NotNull] DatabaseColumn column)
        {
            if (column.StoreType == null)
            {
                return(null);
            }

            var typeScaffoldingInfo = _scaffoldingTypeMapper.FindMapping(
#pragma warning disable CS0618 // Type or member is obsolete
                column.GetUnderlyingStoreType() ?? column.StoreType,
#pragma warning restore CS0618 // Type or member is obsolete
                column.IsKeyOrIndex(),
                column.IsRowVersion());

            if (typeScaffoldingInfo == null)
            {
                return(null);
            }

#pragma warning disable CS0618 // Type or member is obsolete
            return(column.GetUnderlyingStoreType() != null
#pragma warning restore CS0618 // Type or member is obsolete
                ? new TypeScaffoldingInfo(
                       typeScaffoldingInfo.ClrType,
                       inferred: false,
                       scaffoldUnicode: typeScaffoldingInfo.ScaffoldUnicode,
                       scaffoldMaxLength: typeScaffoldingInfo.ScaffoldMaxLength,
                       scaffoldFixedLength: typeScaffoldingInfo.ScaffoldFixedLength)
                : typeScaffoldingInfo);
        }
예제 #2
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 virtual TypeScaffoldingInfo GetTypeScaffoldingInfo([NotNull] DatabaseColumn column)
        {
            if (column.StoreType == null)
            {
                return(null);
            }

            var typeScaffoldingInfo = _scaffoldingTypeMapper.FindMapping(
                column.GetUnderlyingStoreType() ?? column.StoreType,
                column.IsKeyOrIndex(),
                column.IsRowVersion());

            if (typeScaffoldingInfo == null)
            {
                return(null);
            }

            return(column.GetUnderlyingStoreType() != null
                ? new TypeScaffoldingInfo(
                       typeScaffoldingInfo.ClrType,
                       inferred: false,
                       scaffoldUnicode: typeScaffoldingInfo.ScaffoldUnicode,
                       scaffoldMaxLength: typeScaffoldingInfo.ScaffoldMaxLength,
                       scaffoldFixedLength: typeScaffoldingInfo.ScaffoldFixedLength)
                : typeScaffoldingInfo);
        }
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        protected virtual TypeScaffoldingInfo GetTypeScaffoldingInfo([NotNull] DatabaseColumn column)
        {
            if (column.StoreType == null)
            {
                return(null);
            }

            return(_scaffoldingTypeMapper.FindMapping(
                       column.StoreType,
                       column.IsKeyOrIndex(),
                       column.IsRowVersion()));
        }