public void Discover_returns_configuration_when_nonidentity_int_key()
        {
            var modelBuilder = new DbModelBuilder();
            modelBuilder.Entity<Entity>().Property(e => e.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            var model = modelBuilder.Build(new DbProviderInfo("System.Data.SqlClient", "2012"));
            var entityType = model.ConceptualModel.EntityTypes.First();
            var property = entityType.Properties.First(p => p.Name == "Id");

            var configuration = new DatabaseGeneratedDiscoverer()
                .Discover(property, model) as DatabaseGeneratedConfiguration;

            Assert.NotNull(configuration);
            Assert.Equal(StoreGeneratedPattern.None, configuration.StoreGeneratedPattern);
        }
Exemplo n.º 2
0
        public void Discover_returns_configuration_when_nonidentity_int_key()
        {
            var modelBuilder = new DbModelBuilder();

            modelBuilder.Entity <Entity>().Property(e => e.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            var model      = modelBuilder.Build(new DbProviderInfo("System.Data.SqlClient", "2012"));
            var entityType = model.ConceptualModel.EntityTypes.First();
            var property   = entityType.Properties.First(p => p.Name == "Id");

            var configuration = new DatabaseGeneratedDiscoverer()
                                .Discover(property, model) as DatabaseGeneratedConfiguration;

            Assert.NotNull(configuration);
            Assert.Equal(StoreGeneratedPattern.None, configuration.StoreGeneratedPattern);
        }