/// <summary> /// Configures the schema of the view or table that the entity type maps to when targeting a relational database. /// </summary> /// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param> /// <param name="schema"> The schema of the view or table. </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, /// <see langword="null" /> otherwise. /// </returns> public static IConventionEntityTypeBuilder ToSchema( [NotNull] this IConventionEntityTypeBuilder entityTypeBuilder, [CanBeNull] string schema, bool fromDataAnnotation = false) { if (!entityTypeBuilder.CanSetSchema(schema, fromDataAnnotation)) { return(null); } entityTypeBuilder.Metadata.SetSchema(schema, fromDataAnnotation); return(entityTypeBuilder); }