title: Distributed Caching Help
body: <p>I am trying to put some distributed caching into play, I'm using this <a href="http://www.sharedcache.com/cms/homepage.aspx" rel="nofollow noreferrer">indeXus.Net Shared Cache </a>.</p>
  
  <p>It Requires that the object being cached is serializable, which it is here is the class object.</p>
  
  <pre><code>[Serializable]
  public class Members 
  {
      public Members()
      {}
  
      public Members(string aspnetusername, string aspnetpassword,
          string emailaddr,string location)
          : this(0,0,aspnetusername, aspnetpassword,emailaddr,DateTime.Now, location,
          0,0,DateTime.Now,DateTime.Now,DateTime.Now,false)
      { }
  
      public Members(Int64? row,int memberid, string aspnetusername, string aspnetpassword,
          string emailaddr,DateTime datecreated, string location, int daimokugoal, int previewimageid,
          DateTime lastdaimoku, DateTime lastnotifed, DateTime lastactivitydate, bool isactivated)
      {
          this.Row = row;
          this.MemberID = memberid;
          this.Aspnetusername = aspnetusername;
          this.Aspnetpassword = aspnetpassword;
          this.EmailAddr = emailaddr;
          this.DateCreated = datecreated;
          this.Location = location;
          this.DaimokuGoal = daimokugoal;
          this.PreviewImageID = previewimageid;
          this.LastDaimoku = lastdaimoku;
          this.LastNotefied = lastnotifed;
          this.LastActivityDate = lastactivitydate;
          this.IsActivated = this.IsActivated;
          this.Details = new LazyList&lt;MemberDetails&gt;();
          this.Blogs = new LazyList&lt;MemberBlogs&gt;();
          this.Daimoku = new LazyList&lt;MemberDaimoku&gt;();
          this.Determinations = new LazyList&lt;MemberDeterminations&gt;();
          this.Encouragements = new LazyList&lt;MemberEncouragements&gt;();
          this.Entries = new LazyList&lt;MemberEntries&gt;();
          this.Friends = new LazyList&lt;MemberFriends&gt;();
          this.Stats = new LazyList&lt;MemberStats&gt;();
  
  
      }
  
  
  
     public Int64? Row { get; set; }     
     public int MemberID { get; set; }
     public string Aspnetusername { get; set; }
     public string Aspnetpassword { get; set; }
     public string EmailAddr { get; set; }
     public DateTime DateCreated { get; set; }
     public string Location { get; set; }
     public int DaimokuGoal { get; set; }
     public int PreviewImageID { get; set; }
     public DateTime LastDaimoku { get; set; }
     public DateTime LastNotefied { get; set; }
     public DateTime LastActivityDate { get; set; }
     public bool IsActivated { get; set; }
     public LazyList&lt;MemberDetails&gt; Details { get; set; }
     public LazyList&lt;MemberBlogs&gt; Blogs { get; set; }
     public LazyList&lt;MemberDaimoku&gt; Daimoku { get; set; }
     public LazyList&lt;MemberDeterminations&gt; Determinations { get; set; }
     public LazyList&lt;MemberEncouragements&gt; Encouragements { get; set; }
     public LazyList&lt;MemberEntries&gt; Entries { get; set; }
     public LazyList&lt;MemberFriends&gt; Friends { get; set; }
     public LazyList&lt;MemberStats&gt; Stats { get; set; }
  }
  </code></pre>
  
  <p>The LINQtoSql is this that populates this class.</p>
  
  <pre><code>  public IQueryable&lt;Members&gt; GetMemberInfo()
        {
            using (var t = new TransactionScope(TransactionScopeOption.Required,
                      new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted }))
            {
                var results = from m in _datacontext.ViewMembers
                              let details = GetMemberDetails(m.MemberID)
                              let determinations = GetMemberDeterminations(m.MemberID)
                              let daimoku = GetMemberDaimoku(m.MemberID)
                              let entries = GetMemberEntries(m.MemberID)
                              let blogs = GetMemberBlogs(m.MemberID)
                              let encouragements = GetMemberEncouragements(m.MemberID)
                              let friends = GetMemberFriends(m.MemberID)
                              let points = GetMemberStats(m.MemberID)
                              select new Members
                              {
                                  Row = m.Row,
                                  MemberID = m.MemberID,
                                  Aspnetusername = m.Aspnetusername,
                                  Aspnetpassword = m.Aspnetpassword,
                                  EmailAddr = m.EmailAddr,
                                  DateCreated = m.DateCreated,
                                  Location = m.Location,
                                  DaimokuGoal = m.DaimokuGoal,
                                  PreviewImageID = m.PreviewImageID,
                                  LastDaimoku = m.LastDaimoku.Value,
                                  LastNotefied = m.LastNotefied.Value,
                                  LastActivityDate = m.LastActivityDate.Value,
                                  IsActivated = m.IsActivated,
                                  Details = new LazyList&lt;MemberDetails&gt;(details),
                                  Determinations = new LazyList&lt;MemberDeterminations&gt;(determinations),
                                  Daimoku = new LazyList&lt;MemberDaimoku&gt;(daimoku),
                                  Entries = new LazyList&lt;MemberEntries&gt;(entries),
                                  Blogs = new LazyList&lt;MemberBlogs&gt;(blogs),
                                  Encouragements = new LazyList&lt;MemberEncouragements&gt;(encouragements),
                                  Friends = new LazyList&lt;MemberFriends&gt;(friends),
                                  Stats = new LazyList&lt;MemberStats&gt;(points)
                              };
                return results;
            }
        }
  </code></pre>
  
  <p>But for some reason I am getting this error</p>
  
  <p>System.Runtime.Serialization.SerializationException: Type 'System.Data.Linq.DataQuery`1[[DaimokuBeta.MVC.Data.MemberDetails, DaimokuBeta.MVC.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' in Assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.</p>
  
  <p>MemberDetails is serializable too..so not sure why it thinks it can't be serialized
  Any ideas?</p>