コード例 #1
0
 public static void HasVirtualPrimaryKey <TOwnerEntity, TRelatedEntity>(this OwnedNavigationBuilder <TOwnerEntity, TRelatedEntity> entityTypeBuilder)
     where TOwnerEntity : class
     where TRelatedEntity : class
 {
     entityTypeBuilder.HasKey("Id");
     entityTypeBuilder.Property("Id").HasColumnType("bigint");
 }
コード例 #2
0
        private void FileBuildAction(OwnedNavigationBuilder <Person, File?> b)
        {
            b.WithOwner(f => f.Owner);

            b.HasKey(f => f.Id);

            b.Property(f => f.Name)
            .HasMaxLength(StringLengths.Short);

            b.Property(f => f.FileUri)
            .HasConversion <string>()
            .HasMaxLength(StringLengths.Short);

            b.Property(f => f.MimeType)
            .HasMaxLength(StringLengths.VeryShort);
        }
コード例 #3
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");
        }