コード例 #1
0
        public void Configure(EntityTypeBuilder <PageGroup> builder)
        {
            builder.ToTable(nameof(PageGroup), DbConstants.CofoundrySchema);

            builder.Property(s => s.GroupName)
            .IsRequired()
            .HasMaxLength(64);

            builder.HasOne(s => s.ParentPageGroup)
            .WithMany(s => s.ChildPageGroups)
            .HasForeignKey(d => d.ParentGroupId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #2
0
ファイル: PageGroupMap.cs プロジェクト: zerioxen/cofoundry
        public PageGroupMap()
        {
            // Properties
            Property(t => t.GroupName)
            .IsRequired()
            .HasMaxLength(64);

            // Relationships
            HasOptional(t => t.ParentPageGroup)
            .WithMany(t => t.ChildPageGroups)
            .HasForeignKey(d => d.ParentGroupId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #3
0
ファイル: RewriteRuleMap.cs プロジェクト: kishea/kteq-cms
        public void Configure(EntityTypeBuilder <RewriteRule> builder)
        {
            builder.ToTable("RewriteRule", DbConstants.CofoundrySchema);

            // Properties
            builder.Property(s => s.WriteFrom)
            .IsRequired()
            .HasMaxLength(2000);

            builder.Property(s => s.WriteTo)
            .IsRequired()
            .HasMaxLength(2000);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #4
0
        public void Configure(EntityTypeBuilder <DocumentAssetGroup> builder)
        {
            builder.ToTable("DocumentAssetGroup", DbConstants.CofoundrySchema);

            // Properties
            builder.Property(s => s.GroupName)
            .IsRequired()
            .HasMaxLength(64);

            // Relationships
            builder.HasOne(s => s.ParentDocumentAssetGroup)
            .WithMany(s => s.ChildDocumentAssetGroups)
            .HasForeignKey(d => d.ParentDocumentAssetGroupId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #5
0
        public DocumentAssetGroupMap()
        {
            ToTable("DocumentAssetGroup", DbConstants.CofoundrySchema);

            // Properties
            Property(t => t.GroupName)
            .IsRequired()
            .HasMaxLength(64);

            // Relationships
            HasOptional(t => t.ParentDocumentAssetGroup)
            .WithMany(t => t.ChildDocumentAssetGroups)
            .HasForeignKey(d => d.ParentDocumentAssetGroupId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #6
0
        public void Configure(EntityTypeBuilder <CustomEntityVersion> builder)
        {
            builder.ToTable(nameof(CustomEntityVersion), DbConstants.CofoundrySchema);

            builder.Property(s => s.SerializedData)
            .IsRequired();

            builder.Property(s => s.Title)
            .HasMaxLength(200)
            .IsRequired();

            builder.HasOne(s => s.CustomEntity)
            .WithMany(s => s.CustomEntityVersions)
            .HasForeignKey(d => d.CustomEntityId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #7
0
        public CustomEntityVersionMap()
        {
            // Properties
            Property(t => t.SerializedData)
            .IsRequired();

            Property(t => t.Title)
            .HasMaxLength(200)
            .IsRequired();

            // Relationships

            HasRequired(t => t.CustomEntity)
            .WithMany(t => t.CustomEntityVersions)
            .HasForeignKey(d => d.CustomEntityId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #8
0
ファイル: PageTagMap.cs プロジェクト: cofoundry-cms/cofoundry
        public void Configure(EntityTypeBuilder <PageTag> builder)
        {
            builder.ToTable(nameof(PageTag), DbConstants.CofoundrySchema);
            builder.HasKey(s => new { s.PageId, s.TagId });

            builder.Property(s => s.PageId).ValueGeneratedNever();
            builder.Property(s => s.TagId).ValueGeneratedNever();

            builder.HasOne(s => s.Page)
            .WithMany(s => s.PageTags)
            .HasForeignKey(d => d.PageId);

            builder.HasOne(s => s.Tag)
            .WithMany()
            .HasForeignKey(d => d.TagId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #9
0
        public void Configure(EntityTypeBuilder <PageDirectoryLocale> builder)
        {
            builder.ToTable("PageDirectoryLocale", DbConstants.CofoundrySchema);
            builder.HasKey(s => s.PageDirectoryLocaleId);

            builder.Property(s => s.UrlPath)
            .IsRequired()
            .HasMaxLength(64);

            builder.HasOne(s => s.Locale)
            .WithMany()
            .HasForeignKey(d => d.LocaleId);

            builder.HasOne(s => s.PageDirectory)
            .WithMany(s => s.PageDirectoryLocales)
            .HasForeignKey(d => d.PageDirectoryId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #10
0
        public void Configure(EntityTypeBuilder <ImageAssetGroupItem> builder)
        {
            builder.ToTable(nameof(ImageAssetGroupItem), DbConstants.CofoundrySchema);
            builder.HasKey(s => new { s.ImageAssetId, s.ImageAssetGroupId });

            builder.Property(s => s.ImageAssetId).ValueGeneratedNever();

            builder.Property(s => s.ImageAssetGroupId).ValueGeneratedNever();

            builder.HasOne(s => s.ImageAssetGroup)
            .WithMany(s => s.ImageAssetGroupItems)
            .HasForeignKey(d => d.ImageAssetGroupId);

            builder.HasOne(s => s.ImageAsset)
            .WithMany(s => s.ImageAssetGroupItems)
            .HasForeignKey(d => d.ImageAssetId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #11
0
        public WebDirectoryLocaleMap()
        {
            // Primary Key
            HasKey(t => t.WebDirectoryLocaleId);

            // Properties
            Property(t => t.UrlPath)
            .IsRequired()
            .HasMaxLength(64);

            // Relationships
            HasRequired(t => t.Locale)
            .WithMany()
            .HasForeignKey(d => d.LocaleId);
            HasRequired(t => t.WebDirectory)
            .WithMany(t => t.WebDirectoryLocales)
            .HasForeignKey(d => d.WebDirectoryId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #12
0
        public WebDirectoryMap()
        {
            // Primary Key
            HasKey(t => t.WebDirectoryId);

            // Properties
            Property(t => t.Name)
            .IsRequired()
            .HasMaxLength(64);

            Property(t => t.UrlPath)
            .IsRequired()
            .HasMaxLength(64);

            // Relationships
            HasOptional(t => t.ParentWebDirectory)
            .WithMany(t => t.ChildWebDirectories)
            .HasForeignKey(d => d.ParentWebDirectoryId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #13
0
        public PageVersionModuleMap()
        {
            // Properties
            Property(t => t.SerializedData)
            .IsRequired();

            // Relationships
            HasRequired(t => t.PageTemplateSection)
            .WithMany(t => t.PageVersionModules)
            .HasForeignKey(d => d.PageTemplateSectionId);
            HasRequired(t => t.PageModuleType)
            .WithMany(t => t.PageVersionModules)
            .HasForeignKey(d => d.PageModuleTypeId);
            HasRequired(t => t.PageVersion)
            .WithMany(t => t.PageVersionModules)
            .HasForeignKey(d => d.PageVersionId);
            HasOptional(t => t.PageModuleTypeTemplate)
            .WithMany()
            .HasForeignKey(t => t.PageModuleTypeTemplateId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #14
0
ファイル: PageTagMap.cs プロジェクト: zerioxen/cofoundry
        public PageTagMap()
        {
            // Primary Key
            HasKey(t => new { t.PageId, t.TagId });

            // Properties
            Property(t => t.PageId)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            Property(t => t.TagId)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Relationships
            HasRequired(t => t.Page)
            .WithMany(t => t.PageTags)
            .HasForeignKey(d => d.PageId);
            HasRequired(t => t.Tag)
            .WithMany()
            .HasForeignKey(d => d.TagId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #15
0
        public void Configure(EntityTypeBuilder <DocumentAssetTag> builder)
        {
            builder.ToTable(nameof(DocumentAssetTag), DbConstants.CofoundrySchema);
            builder.HasKey(s => new { s.DocumentAssetId, s.TagId });

            builder.Property(s => s.DocumentAssetId)
            .ValueGeneratedNever();

            builder.Property(s => s.TagId)
            .ValueGeneratedNever();

            builder.HasOne(s => s.DocumentAsset)
            .WithMany(s => s.DocumentAssetTags)
            .HasForeignKey(d => d.DocumentAssetId);

            builder.HasOne(s => s.Tag)
            .WithMany()
            .HasForeignKey(d => d.TagId)
            .OnDelete(DeleteBehavior.Restrict);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #16
0
        public CustomEntityMap()
        {
            // Properties
            Property(t => t.CustomEntityDefinitionCode)
            .HasMaxLength(6)
            .IsFixedLength()
            .IsUnicode(false);

            Property(t => t.UrlSlug)
            .HasMaxLength(200)
            .IsRequired();

            // Relationships
            HasRequired(t => t.CustomEntityDefinition)
            .WithMany()
            .HasForeignKey(d => d.CustomEntityDefinitionCode);

            HasOptional(t => t.Locale)
            .WithMany()
            .HasForeignKey(d => d.LocaleId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #17
0
        public void Configure(EntityTypeBuilder <PageDirectory> builder)
        {
            builder.ToTable("PageDirectory", DbConstants.CofoundrySchema);

            // Primary Key
            builder.HasKey(s => s.PageDirectoryId);

            // Properties
            builder.Property(s => s.Name)
            .IsRequired()
            .HasMaxLength(64);

            builder.Property(s => s.UrlPath)
            .IsRequired()
            .HasMaxLength(64);

            // Relationships
            builder.HasOne(s => s.ParentPageDirectory)
            .WithMany(s => s.ChildPageDirectories)
            .HasForeignKey(d => d.ParentPageDirectoryId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #18
0
        public void Configure(EntityTypeBuilder <PageVersion> builder)
        {
            builder.ToTable("PageVersion", DbConstants.CofoundrySchema);

            // Properties

            builder.Property(s => s.Title)
            .IsRequired()
            .HasMaxLength(300);

            builder.Property(s => s.MetaDescription)
            .IsRequired()
            .HasMaxLength(300);

            builder.Property(s => s.OpenGraphTitle)
            .HasMaxLength(300);

            // Relationships

            builder.HasOne(s => s.OpenGraphImageAsset)
            .WithMany()
            .HasForeignKey(d => d.OpenGraphImageId);

            builder.HasOne(s => s.PageTemplate)
            .WithMany(s => s.PageVersions)
            .HasForeignKey(d => d.PageTemplateId);

            builder.HasOne(s => s.Page)
            .WithMany(s => s.PageVersions)
            .HasForeignKey(d => d.PageId);

            builder.HasOne(s => s.BasedOnPageVersion)
            .WithMany(s => s.ChildPageVersions)
            .HasForeignKey(d => d.BasedOnPageVersionId);

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #19
0
ファイル: PageMap.cs プロジェクト: cofoundry-cms/cofoundry
        public void Configure(EntityTypeBuilder <Page> builder)
        {
            builder.ToTable(nameof(Page), DbConstants.CofoundrySchema);

            builder.Property(s => s.UrlPath)
            .IsRequired()
            .HasMaxLength(200);

            builder.Property(s => s.CustomEntityDefinitionCode)
            .HasMaxLength(6)
            .IsUnicode(false);

            builder.Property(s => s.PublishStatusCode)
            .HasMaxLength(1)
            .IsUnicode(false);

            builder.HasOne(s => s.Locale)
            .WithMany()
            .HasForeignKey(d => d.LocaleId);

            builder.HasOne(s => s.CustomEntityDefinition)
            .WithMany()
            .HasForeignKey(d => d.CustomEntityDefinitionCode);

            builder.HasOne(s => s.PageDirectory)
            .WithMany(s => s.Pages)
            .HasForeignKey(d => d.PageDirectoryId);

            builder.HasOne(s => s.UserAreaForSignInRedirect)
            .WithMany()
            .HasForeignKey(s => s.UserAreaCodeForSignInRedirect);

            builder.Property(s => s.PublishDate).IsUtc();
            builder.Property(s => s.LastPublishDate).IsUtc();

            CreateAuditableMappingHelper.Map(builder);
        }
コード例 #20
0
        public ImageAssetGroupItemMap()
        {
            ToTable("ImageAssetGroupItem", DbConstants.CofoundrySchema);

            // Primary Key
            HasKey(t => new { t.ImageAssetId, t.ImageAssetGroupId });

            // Properties
            Property(t => t.ImageAssetId)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            Property(t => t.ImageAssetGroupId)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Relationships
            HasRequired(t => t.ImageAssetGroup)
            .WithMany(t => t.ImageAssetGroupItems)
            .HasForeignKey(d => d.ImageAssetGroupId);
            HasRequired(t => t.ImageAsset)
            .WithMany(t => t.ImageAssetGroupItems)
            .HasForeignKey(d => d.ImageAssetId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #21
0
ファイル: PageMap.cs プロジェクト: zerioxen/cofoundry
        public PageMap()
        {
            // Properties
            Property(t => t.UrlPath)
            .IsRequired()
            .HasMaxLength(70);
            Property(t => t.CustomEntityDefinitionCode)
            .HasMaxLength(6);

            // Relationships
            HasOptional(t => t.Locale)
            .WithMany()
            .HasForeignKey(d => d.LocaleId);

            HasOptional(t => t.CustomEntityDefinition)
            .WithMany()
            .HasForeignKey(d => d.CustomEntityDefinitionCode);

            HasRequired(t => t.WebDirectory)
            .WithMany(t => t.Pages)
            .HasForeignKey(d => d.WebDirectoryId);

            CreateAuditableMappingHelper.Map(this);
        }
コード例 #22
0
        public DocumentAssetTagMap()
        {
            ToTable("DocumentAssetTag", DbConstants.CofoundrySchema);

            // Primary Key
            HasKey(t => new { t.DocumentAssetId, t.TagId });

            // Properties
            Property(t => t.DocumentAssetId)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            Property(t => t.TagId)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Relationships
            HasRequired(t => t.DocumentAsset)
            .WithMany(t => t.DocumentAssetTags)
            .HasForeignKey(d => d.DocumentAssetId);
            HasRequired(t => t.Tag)
            .WithMany()
            .HasForeignKey(d => d.TagId);

            CreateAuditableMappingHelper.Map(this);
        }