public static IndexBuilder SharedNameExtension(this IndexBuilder builder, string value) { builder.HasAnnotation("Annotation", value + ".Annotation"); builder.Metadata["Metadata"] = value + ".Metadata"; builder.GetInfrastructure <IMutableModel>()["Model"] = value + ".Model"; return(builder); }
/// <summary> /// Configures the name of the index in the database when targeting a relational database. /// </summary> /// <param name="indexBuilder"> The builder for the index being configured. </param> /// <param name="name"> The name of the index. </param> /// <returns> A builder to further configure the index. </returns> public static IndexBuilder HasName([NotNull] this IndexBuilder indexBuilder, [CanBeNull] string name) { Check.NotNull(indexBuilder, nameof(indexBuilder)); Check.NullButNotEmpty(name, nameof(name)); indexBuilder.GetInfrastructure <InternalIndexBuilder>().Relational(ConfigurationSource.Explicit).HasName(name); return(indexBuilder); }