Ejemplo n.º 1
0
 public static void Setup <T>(OwnedNavigationBuilder <T, AcceptDeclaration> entity) where T : class
 {
     entity.WithOwner();
     entity.Property(e => e.IsAccepted).IsRequired();
     entity.Property(e => e.Email).IsRequired();
     entity.Property(e => e.Timestamp).IsRequired();
 }
Ejemplo n.º 2
0
 public static void Setup <T>(OwnedNavigationBuilder <T, ClubMembership> entity) where T : class
 {
     entity.WithOwner();
     entity.Property(e => e.ClubName).IsRequired();
     entity.Property(e => e.MembershipNumber).IsRequired();
     entity.Property(e => e.Expiry).IsRequired();
 }
        public static void ConfigureAddress <TParentEntity>(this OwnedNavigationBuilder <TParentEntity, PostalAddress> a) where TParentEntity : class
        {
            a.WithOwner();

            a.Property(a => a.RecipientName)
            .HasMaxLength(255)
            .IsRequired();

            a.Property(a => a.ZipCode)
            .HasMaxLength(18)
            .IsRequired();

            a.Property(a => a.Street)
            .HasMaxLength(180)
            .IsRequired();

            a.Property(a => a.State)
            .HasMaxLength(60);

            a.Property(a => a.Country)
            .HasMaxLength(90)
            .IsRequired();

            a.Property(a => a.City)
            .HasMaxLength(100)
            .IsRequired();
        }
Ejemplo n.º 4
0
 public static void Setup <T>(OwnedNavigationBuilder <T, Vehicle> entity) where T : class
 {
     entity.WithOwner();
     entity.Property(e => e.Displacement).IsRequired();
     entity.Property(e => e.Make).IsRequired();
     entity.Property(e => e.Model).IsRequired();
     entity.Property(e => e.Registration).IsRequired();
     entity.Property(e => e.Year).IsRequired();
     entity.Property(e => e.Induction).IsRequired();
 }
        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);
        }
Ejemplo n.º 6
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");
        }
Ejemplo n.º 7
0
 public override TestOwnershipBuilder <TEntity, TDependentEntity> WithOwner(
     Expression <Func <TDependentEntity, TEntity?> >?referenceExpression)
 => new GenericTestOwnershipBuilder <TEntity, TDependentEntity>(
     OwnedNavigationBuilder.WithOwner(referenceExpression?.GetMemberAccess().GetSimpleMemberName()));
Ejemplo n.º 8
0
 public static void Setup <T>(OwnedNavigationBuilder <T, EmergencyContact> entity) where T : class
 {
     entity.WithOwner();
     entity.Property(e => e.Name).IsRequired();
     entity.Property(e => e.Phone).IsRequired();
 }
Ejemplo n.º 9
0
 public static void Setup <T>(OwnedNavigationBuilder <T, MsaMembership> entity) where T : class
 {
     entity.WithOwner();
     entity.Property(e => e.MsaLicenseType).IsRequired();
     entity.Property(e => e.MsaLicense).IsRequired();
 }