/// <summary>
        ///     Sets the key constraint name for this key.
        /// </summary>
        /// <param name="key"> The key. </param>
        /// <param name="name"> The value to set. </param>
        /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
        /// <returns> The configured name. </returns>
        public static string SetName([NotNull] this IConventionKey key, [CanBeNull] string name, bool fromDataAnnotation = false)
        {
            key.SetOrRemoveAnnotation(
                RelationalAnnotationNames.Name,
                Check.NullButNotEmpty(name, nameof(name)),
                fromDataAnnotation);

            return(name);
        }
 /// <summary>
 ///     Sets a value indicating whether the key is clustered.
 /// </summary>
 /// <param name="key"> The key. </param>
 /// <param name="clustered"> The value to set. </param>
 /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
 public static void SetSqlServerIsClustered([NotNull] this IConventionKey key, bool?clustered, bool fromDataAnnotation = false)
 => key.SetOrRemoveAnnotation(SqlServerAnnotationNames.Clustered, clustered, fromDataAnnotation);
示例#3
0
        /// <summary>
        ///     Sets a value indicating whether the key is clustered.
        /// </summary>
        /// <param name="key"> The key. </param>
        /// <param name="clustered"> The value to set. </param>
        /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
        /// <returns> The configured value. </returns>
        public static bool?SetIsClustered([NotNull] this IConventionKey key, bool?clustered, bool fromDataAnnotation = false)
        {
            key.SetOrRemoveAnnotation(SqlServerAnnotationNames.Clustered, clustered, fromDataAnnotation);

            return(clustered);
        }
 /// <summary>
 ///     Sets prefix lengths for the key.
 /// </summary>
 /// <param name="values"> The prefix lengths to set.
 /// A value of `0` indicates, that the full length should be used for that column. </param>
 /// <param name="key"> The key. </param>
 /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param>
 public static void SetPrefixLength(
     [NotNull] this IConventionKey key, int[] values, bool fromDataAnnotation = false)
 => key.SetOrRemoveAnnotation(
     MySqlAnnotationNames.IndexPrefixLength,
     values,
     fromDataAnnotation);