Esempio n. 1
0
        /// <summary>
        ///     <para>
        ///         Attempts to configure the maximum size for Azure SQL Database.
        ///     </para>
        ///     <para>
        ///         Units must be included, e.g. "100 MB". See Azure SQL Database documentation for all supported values.
        ///     </para>
        /// </summary>
        /// <param name="modelBuilder"> The model builder. </param>
        /// <param name="maxSize"> The maximum size of the database. </param>
        /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
        /// <returns>
        ///     The same builder instance if the configuration was applied,
        ///     <c>null</c> otherwise.
        /// </returns>
        public static IConventionModelBuilder HasDatabaseMaxSize(
            [NotNull] this IConventionModelBuilder modelBuilder, [CanBeNull] string maxSize, bool fromDataAnnotation = false)
        {
            if (modelBuilder.CanSetDatabaseMaxSize(maxSize, fromDataAnnotation))
            {
                modelBuilder.Metadata.SetDatabaseMaxSize(maxSize, fromDataAnnotation);
                return(modelBuilder);
            }

            return(null);
        }