/// <summary> /// Configures the table name that this entity type is mapped to. /// </summary> /// <param name="tableName"> The name of the table. </param> public void ToTable(string tableName) { Check.NotEmpty(tableName, "tableName"); var databaseName = DatabaseName.Parse(tableName); _entityTypeConfiguration.ToTable(databaseName.Name, databaseName.Schema); }
/// <summary> /// Configures the table name that this entity type is mapped to. /// </summary> /// <param name="tableName"> The name of the table. </param> public EntityTypeConfiguration <TEntityType> ToTable(string tableName) { Check.NotEmpty(tableName, "tableName"); var databaseName = DatabaseName.Parse(tableName); _entityTypeConfiguration.ToTable(databaseName.Name, databaseName.Schema); return(this); }
public void Cloning_an_entity_configuration_clones_its_mapping_information() { var configuration = new EntityTypeConfiguration(typeof(object)); configuration.ToTable("Table"); var clone = configuration.Clone(); Assert.Equal("Table", clone.GetTableName().Name); configuration.ToTable("AnotherTable"); Assert.Equal("Table", clone.GetTableName().Name); }
public void Cloning_an_entity_configuration_clones_its_mapping_information() { var configuration = new EntityTypeConfiguration(typeof(object)); configuration.ToTable("Table"); configuration.SetAnnotation("A1", "V1"); var clone = configuration.Clone(); Assert.Equal("Table", clone.GetTableName().Name); Assert.Equal("A1", clone.Annotations.Single().Key); Assert.Equal("V1", clone.Annotations.Single().Value); configuration.ToTable("AnotherTable"); configuration.SetAnnotation("A2", "V2"); Assert.Equal("Table", clone.GetTableName().Name); Assert.Equal("A1", clone.Annotations.Single().Key); Assert.Equal("V1", clone.Annotations.Single().Value); }
public void Cloning_an_entity_configuration_clones_its_scalar_properties() { var configuration = new EntityTypeConfiguration(typeof(object)); configuration.IsReplaceable = true; configuration.ToTable("Table"); configuration.IsExplicitEntity = true; configuration.EntitySetName = "ESN"; var clone = configuration.Clone(); Assert.True(clone.IsReplaceable); Assert.True(clone.IsTableNameConfigured); Assert.True(clone.IsExplicitEntity); Assert.Equal("ESN", clone.EntitySetName); Assert.Same(typeof(object), clone.ClrType); }