コード例 #1
0
        public void HasEntitySetName_configured_using_configuration()
        {
            var modelBuilder = new AdventureWorksModelBuilder();

            var configuration = new EntityTypeConfiguration <UnitMeasure>();

            configuration.HasKey(u => u.UnitMeasureCode);
            configuration.HasEntitySetName("Units");

            modelBuilder.Configurations.Add(configuration);

            var databaseMapping = BuildMapping(modelBuilder);

            databaseMapping.AssertValid();

            Assert.Equal("Units", databaseMapping.Model.Containers.Single().EntitySets.Single().Name);
        }