Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.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# 类型为';的未处理异常;System.StackOverflowException';实体框架_C#_Entity Framework - Fatal编程技术网

C# 类型为';的未处理异常;System.StackOverflowException';实体框架

C# 类型为';的未处理异常;System.StackOverflowException';实体框架,c#,entity-framework,C#,Entity Framework,我得到了最奇怪的问题;我降级到了ef5 6,但现在我得到了下面这条线上的跟随,它崩溃了 /// <summary> /// Initializes a new SMBASchedulerEntities object using the connection string found in the 'SMBASchedulerEntities' section of the application configuration file. /// </summary>

我得到了最奇怪的问题;我降级到了ef5 6,但现在我得到了下面这条线上的跟随,它崩溃了

 /// <summary>
 /// Initializes a new SMBASchedulerEntities object using the connection string found in the 'SMBASchedulerEntities' section of the application configuration file.
 /// </summary>
public SMBASchedulerEntities() : base("name=SMBASchedulerEntities", "SMBASchedulerEntities")
{
    this.ContextOptions.LazyLoadingEnabled = true;
    OnContextCreated();
}

我不知道这里发生了什么,因为我以前从未遇到过这个错误。

您正在属性getter中引用您的属性

 private SMBASchedulerEntities _SourceEntities;
 public SMBASchedulerEntities SourceEntities
 {
      get
      {

          _SourceEntities = new SMBASchedulerEntities();


          return SourceEntities; <-- should be _SourceEntities 
      }
}
私有SMBASScheduleEntities\u SourceEntities;
公共SMBASScheduleEntities源实体
{
得到
{
_SourceEntities=新的SMBASScheduleEntities();
返回源实体;
 private SMBASchedulerEntities _SourceEntities;
 public SMBASchedulerEntities SourceEntities
 {
      get
      {

          _SourceEntities = new SMBASchedulerEntities();


          return SourceEntities; <-- should be _SourceEntities 
      }
}