// Decompiled with JetBrains decompiler
// Type: SE0085.Q2CdB.MDSS_dbmor_dEntities
// Assembly: SE0085Q2CdB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A5680110-30A2-457F-A920-E4C024719231
// Assembly location: C:\Users\Abishek\Downloads\SchneiderCode_Breaker_09292016\Breaker Schedule-20160930T014118Z\Breaker Schedule\Solution for gathering Breaker Data\DMS\bin\Debug\SE0085Q2CdB.dll

using System;
using System.Collections.Generic;
using System.Data.EntityClient;
using System.Data.Objects;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;

namespace SE0085.Q2CdB
{
  public class MDSS_dbmor_dEntities : ObjectContext
  {
    private static List<WeakReference> __ENCList = new List<WeakReference>();
    private ObjectSet<SE0085.Q2CdB.mdsbodq2c> _mdsbodq2c;
    private ObjectSet<mdsbodtd> _mdsbodtds;

    public ObjectSet<SE0085.Q2CdB.mdsbodq2c> mdsbodq2c
    {
      get
      {
        if (this._mdsbodq2c == null)
          this._mdsbodq2c = (ObjectSet<SE0085.Q2CdB.mdsbodq2c>) this.CreateObjectSet<SE0085.Q2CdB.mdsbodq2c>("mdsbodq2c");
        return this._mdsbodq2c;
      }
    }

    public ObjectSet<mdsbodtd> mdsbodtds
    {
      get
      {
        if (this._mdsbodtds == null)
          this._mdsbodtds = (ObjectSet<mdsbodtd>) this.CreateObjectSet<mdsbodtd>("mdsbodtds");
        return this._mdsbodtds;
      }
    }

    [DebuggerNonUserCode]
    static MDSS_dbmor_dEntities()
    {
    }

    public MDSS_dbmor_dEntities()
      : base("name=MDSS_dbmor_dEntities", "MDSS_dbmor_dEntities")
    {
      MDSS_dbmor_dEntities.__ENCAddToList((object) this);
      this.get_ContextOptions().set_LazyLoadingEnabled(true);
    }

    public MDSS_dbmor_dEntities(string connectionString)
      : base(connectionString, "MDSS_dbmor_dEntities")
    {
      MDSS_dbmor_dEntities.__ENCAddToList((object) this);
      this.get_ContextOptions().set_LazyLoadingEnabled(true);
    }

    public MDSS_dbmor_dEntities(EntityConnection connection)
      : base(connection, "MDSS_dbmor_dEntities")
    {
      MDSS_dbmor_dEntities.__ENCAddToList((object) this);
      this.get_ContextOptions().set_LazyLoadingEnabled(true);
    }

    [DebuggerNonUserCode]
    private static void __ENCAddToList(object value)
    {
      List<WeakReference> encList = MDSS_dbmor_dEntities.__ENCList;
      bool flag = false;
      try
      {
        Monitor.Enter((object) encList, ref flag);
        if (MDSS_dbmor_dEntities.__ENCList.Count == MDSS_dbmor_dEntities.__ENCList.Capacity)
        {
          int index1 = 0;
          int num1 = 0;
          int num2 = checked (MDSS_dbmor_dEntities.__ENCList.Count - 1);
          int index2 = num1;
          while (index2 <= num2)
          {
            if (MDSS_dbmor_dEntities.__ENCList[index2].IsAlive)
            {
              if (index2 != index1)
                MDSS_dbmor_dEntities.__ENCList[index1] = MDSS_dbmor_dEntities.__ENCList[index2];
              checked { ++index1; }
            }
            checked { ++index2; }
          }
          MDSS_dbmor_dEntities.__ENCList.RemoveRange(index1, checked (MDSS_dbmor_dEntities.__ENCList.Count - index1));
          MDSS_dbmor_dEntities.__ENCList.Capacity = MDSS_dbmor_dEntities.__ENCList.Count;
        }
        MDSS_dbmor_dEntities.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
      }
      finally
      {
        if (flag)
          Monitor.Exit((object) encList);
      }
    }

    public void AddTomdsbodq2c(SE0085.Q2CdB.mdsbodq2c mdsbodq2c)
    {
      this.AddObject("mdsbodq2c", (object) mdsbodq2c);
    }

    public void AddTomdsbodtds(mdsbodtd mdsbodtd)
    {
      this.AddObject("mdsbodtds", (object) mdsbodtd);
    }
  }
}
