This DbModelBuilder convention uses the namespace of the derived DbContext class as the namespace of the conceptual model built by Code First.
Inheritance: IConfigurationConvention
コード例 #1
0
        public void Apply_should_set_model_namespace()
        {
            var convention = new ModelNamespaceConvention("Foo");
            var modelConfiguration = new ModelConfiguration();

            convention.Apply(modelConfiguration);

            Assert.Equal("Foo", modelConfiguration.ModelNamespace);
        }
コード例 #2
0
        public void Apply_should_set_model_namespace()
        {
            var convention         = new ModelNamespaceConvention("Foo");
            var modelConfiguration = new ModelConfiguration();

            convention.ApplyModelConfiguration(modelConfiguration);

            Assert.Equal("Foo", modelConfiguration.ModelNamespace);
        }