Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 有没有一种方法可以构建从一个表到另一个表的lazyload路径?_C#_Webforms_Entity Framework 5_Asp.net 4.5 - Fatal编程技术网

C# 有没有一种方法可以构建从一个表到另一个表的lazyload路径?

C# 有没有一种方法可以构建从一个表到另一个表的lazyload路径?,c#,webforms,entity-framework-5,asp.net-4.5,C#,Webforms,Entity Framework 5,Asp.net 4.5,我的EF代码第一个站点有两个类,我可以使用lazyloding从类节翻译到类节(即节翻译.Section.XXXX),但我不能从节翻译到节翻译(即节翻译.Section.XXXX)我不知道我需要做些什么才能让我从一个章节翻译到另一个章节 第1.cs节 using FFInfo.DAL.GeneralTranslationTables; using System; using System.Collections.Generic; using System.ComponentModel.DataA

我的EF代码第一个站点有两个类,我可以使用lazyloding从类节翻译到类节(即节翻译.Section.XXXX),但我不能从节翻译到节翻译(即节翻译.Section.XXXX)我不知道我需要做些什么才能让我从一个章节翻译到另一个章节

第1.cs节

using FFInfo.DAL.GeneralTranslationTables;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FFInfo.DAL.GeneralTables
{
    [Table("Section")]
    public class Section
    {
        [Key, Required, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Int16 SectionID { get; set; }

        public Int64? LogoFileID { get; set; }

        [Required, MaxLength(15), Column(TypeName = "varchar")]
        public string RouteName { get; set; }

        [Required, MaxLength(15), Column(TypeName = "varchar")]
        public string SectionType { get; set; }

        public virtual IList<Section_Translation> SectionTranslations { get; set; }

        [ForeignKey("LogoFileID")]
        public virtual File File { get; set; }
    }
}

与同事交谈时,EF似乎不允许像我希望的那样构建延迟加载

using FFInfo.DAL.GeneralTables;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FFInfo.DAL.GeneralTranslationTables
{
    [Table("SectionTranslation")]
    public class Section_Translation
    {
        [Key, Required, Column(Order = 0)]
        public Int16 SectionID { get; set; }

        [Key, Required, Column(Order = 1)]
        public byte CultureCodeID { get; set; }

        [Required]
        public string SectionTitle { get; set; }

        public string Synopsis { get; set; }

        [ForeignKey("SectionID")]
        public virtual Section Section { get; set; }

        [ForeignKey("CultureID")]
        public virtual CultureCode Culture { get; set; }
    }
}