Beispiel #1
0
        public void Can_create_unique_index_from_properties()
        {
            var entityType = new Model().AddEntityType(typeof(Customer));
            var property1 = entityType.GetOrAddProperty(Customer.IdProperty);
            var property2 = entityType.GetOrAddProperty(Customer.NameProperty);

            var index = new Index(new[] { property1, property2 }) { IsUnique = true };

            Assert.True(new[] { property1, property2 }.SequenceEqual(index.Properties));
            Assert.True(index.IsUnique.Value);
        }
Beispiel #2
0
        public void Can_create_unique_index_from_properties()
        {
            var entityType = new EntityType("E");
            var property1 = entityType.AddProperty(Customer.IdProperty);
            var property2 = entityType.AddProperty(Customer.NameProperty);

            var index = new Index(new[] { property1, property2 }) { IsUnique = true, };

            Assert.True(new[] { property1, property2 }.SequenceEqual(index.Properties));
            Assert.True(index.IsUnique);
        }
        public SqlServerIndexBuilder([NotNull] Index index)
        {
            Check.NotNull(index, nameof(index));

            _index = index;
        }
Beispiel #4
0
        public NpgsqlIndexBuilder([NotNull] Index index)
        {
            Check.NotNull(index, nameof(index));

            _index = index;
        }
        public RelationalIndexBuilder([NotNull] Index index)
        {
            Check.NotNull(index, nameof(index));

            _index = index;
        }