Exemplo n.º 1
0
            protected override void OnModelCreating(ModelBuilder modelBuilder)
            {
                modelBuilder.Entity <Customer>(
                    cb =>
                {
                    var valueGeneratorFactory = new CustomPartitionKeyIdValueGeneratorFactory();

                    cb.Property(c => c.Id);
                    cb.HasKey(c => new { c.Id });
                });
            }
Exemplo n.º 2
0
            protected override void OnModelCreating(ModelBuilder modelBuilder)
            {
                modelBuilder.Entity <Customer>(
                    cb =>
                {
                    var valueGeneratorFactory = new CustomPartitionKeyIdValueGeneratorFactory();

                    cb.HasNoDiscriminator();
                    cb.Property(c => c.Id).HasConversion <string>();
                    cb.HasPartitionKey(c => c.Id);
                });
            }
Exemplo n.º 3
0
            protected override void OnModelCreating(ModelBuilder modelBuilder)
            {
                modelBuilder.Entity <Customer>(
                    cb =>
                {
                    var valueGeneratorFactory = new CustomPartitionKeyIdValueGeneratorFactory();

                    cb.Property(StoreKeyConvention.DefaultIdPropertyName).HasValueGenerator((Type)null);

                    cb.Property(c => c.PartitionKey).HasConversion <string>();

                    cb.HasPartitionKey(c => c.PartitionKey);
                    cb.HasKey(c => new { c.PartitionKey, c.Id });
                });
            }
Exemplo n.º 4
0
            protected override void OnModelCreating(ModelBuilder modelBuilder)
            {
                modelBuilder.Entity <Customer>(
                    cb =>
                {
                    var valueGeneratorFactory = new CustomPartitionKeyIdValueGeneratorFactory();

                    cb.Property("id")
                    .HasValueGenerator((p, e) => valueGeneratorFactory.Create(p));

                    cb.Property(c => c.Id);
                    cb.Property(c => c.PartitionKey).HasConversion <string>();

                    cb.HasPartitionKey(c => c.PartitionKey);
                    cb.HasKey(c => new { c.PartitionKey, c.Id });
                });
            }