コード例 #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();
 }
コード例 #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();
 }
コード例 #3
0
        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();
        }
コード例 #4
0
ファイル: SetupVehicle.cs プロジェクト: luhis/AutoTest
 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();
 }
コード例 #5
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);
        }
コード例 #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");
        }
コード例 #7
0
 public override TestOwnershipBuilder <TEntity, TDependentEntity> WithOwner(
     Expression <Func <TDependentEntity, TEntity?> >?referenceExpression)
 => new GenericTestOwnershipBuilder <TEntity, TDependentEntity>(
     OwnedNavigationBuilder.WithOwner(referenceExpression?.GetMemberAccess().GetSimpleMemberName()));
コード例 #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();
 }
コード例 #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();
 }