/// <summary> /// Configures the property that is used to store the partition key. /// </summary> /// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param> /// <param name="name"> The name of the partition key property. </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 IConventionEntityTypeBuilder ForCosmosHasPartitionKey( [NotNull] this IConventionEntityTypeBuilder entityTypeBuilder, [CanBeNull] string name, bool fromDataAnnotation = false) { if (!entityTypeBuilder.ForCosmosCanSetPartitionKey(name, fromDataAnnotation)) { return(null); } entityTypeBuilder.Metadata.SetCosmosPartitionKeyPropertyName(name, fromDataAnnotation); return(entityTypeBuilder); }