protected override void Configure(OwnedNavigationBuilder <Level1, Level2> l2)
        {
            base.Configure(l2);

            l2.ToTable(nameof(Level1));
            l2.Property(l => l.Date).HasColumnName("OneToOne_Required_PK_Date");
        }
예제 #2
0
        public static OwnedNavigationBuilder <TEntity, TRoute> ConfigureRoute <TEntity, TRoute>(
            [NotNull] this OwnedNavigationBuilder <TEntity, TRoute> builder,
            [CanBeNull] string tablePrefix = "",
            [CanBeNull] string schema      = null)
            where TEntity : class
            where TRoute : Route
        {
            builder.ToTable(tablePrefix + "Routes", schema);

            builder
            .Property(p => p.DisplayName)
            .HasMaxLength(RouteConsts.MaxDisplayNameLength)
            .HasColumnName(nameof(Route.DisplayName))
            .IsRequired();
            builder
            .Property(p => p.Name)
            .HasMaxLength(RouteConsts.MaxNameLength)
            .HasColumnName(nameof(Route.Name))
            .IsRequired();
            builder
            .Property(p => p.Path)
            .HasMaxLength(RouteConsts.MaxPathLength)
            .HasColumnName(nameof(Route.Path));
            builder
            .Property(p => p.Redirect)
            .HasMaxLength(RouteConsts.MaxRedirectLength)
            .HasColumnName(nameof(Route.Redirect));

            return(builder);
        }
    protected override void Configure(OwnedNavigationBuilder <Level3, Level4> l4)
    {
        base.Configure(l4);

        l4.ToTable(nameof(Level1), tb => tb.IsTemporal(ttb =>
        {
            ttb.HasPeriodStart("PeriodStart").HasColumnName("PeriodStart");
            ttb.HasPeriodEnd("PeriodEnd").HasColumnName("PeriodEnd");
        }));
    }
예제 #4
0
        internal static void Configure(OwnedNavigationBuilder <SkillSnapshot, SkillReference> builder)
        {
            builder.ToTable(name: "SkillSnapshotSkillReferences");

            builder.WithOwner()
            .HasForeignKey("SkillSnapshotId");

            builder.Property(id => id.Id)
            .HasColumnName("SkillId")
            .ValueGeneratedNever();

            builder.Property(colour => colour.Colour)
            .HasColumnName("SkillColour");

            builder.HasKey("SkillSnapshotId", "Id");
        }
 /// <summary>
 ///     Configures the table that the entity type maps to when targeting a relational database.
 /// </summary>
 /// <param name="referenceOwnershipBuilder"> The builder for the entity type being configured. </param>
 /// <param name="name"> The name of the table. </param>
 /// <param name="schema"> The schema of the table. </param>
 /// <returns> The same builder instance so that multiple calls can be chained. </returns>
 public static OwnedNavigationBuilder ToTable(
     [NotNull] this OwnedNavigationBuilder referenceOwnershipBuilder,
     [CanBeNull] string name,
     [CanBeNull] string schema)
 => referenceOwnershipBuilder.ToTable(name, schema, excludedFromMigrations: false);
 /// <summary>
 ///     Configures the table that the entity type maps to when targeting a relational database.
 /// </summary>
 /// <param name="referenceOwnershipBuilder"> The builder for the entity type being configured. </param>
 /// <param name="name"> The name of the table. </param>
 /// <param name="excludedFromMigrations"> A value indicating whether the table should be managed by migrations. </param>
 /// <returns> The same builder instance so that multiple calls can be chained. </returns>
 public static OwnedNavigationBuilder ToTable(
     [NotNull] this OwnedNavigationBuilder referenceOwnershipBuilder,
     [CanBeNull] string name,
     bool excludedFromMigrations)
 => referenceOwnershipBuilder.ToTable(name, null, excludedFromMigrations);
        protected override void Configure(OwnedNavigationBuilder <Level3, Level4> l4)
        {
            base.Configure(l4);

            l4.ToTable(nameof(Level1));
        }
        protected override void Configure(OwnedNavigationBuilder <Level2, Level3> l3)
        {
            base.Configure(l3);

            l3.ToTable(nameof(Level1));
        }