title: MVC C# Saving a list to database
body: <p>I'm saving properties in my database with the CreateAMeeting method. When I check the database I can see all properties saved except my list, I can't see my list properties in my database. I have been googling but I can't find if it's possible to see them or if I'm just not saving them properly. If I use a breakpoint I can see that the meeting(db.Meetings.Add(meeting);) model have the times i added in the Times list.</p>
  
  <p>When I later try to retrieve my list in the ChooseTimes method, it's null. I don't know if the problem is that I'm saving it wrong or its something else. What am I doing wrong and is it possible to see saved lists in the database? </p>
  
  <p>I'm not done with the fooreachloop, pay no attention to it.</p>
  
  <pre><code>public class MeetingController : BaseController
  {
      private ApplicationSignInManager _signInManager;
      private ApplicationUserManager _userManager;
      public static Meeting NewMeeting;
      public static List&lt;DateTime&gt; TempTimes = new List&lt;DateTime&gt;();
  
      public ActionResult CreateMeeting()
      {
          return View();
      }
  
      public ActionResult CreateAMeeting(Meeting meeting)
      {
          var userName = User.Identity.Name;
          var user = db.Users.Where(u =&gt; u.UserName == userName).SingleOrDefault();
          var model = new MeetingPeopleViewModel();
  
          meeting.Creator = user;
          meeting.Invited.Add(user);
          meeting.Times = TempTimes;
          meeting.Start = DateTime.Now;
          meeting.End = meeting.Start.AddMinutes(meeting.Minutes);
          db.Meetings.Add(meeting);
          db.SaveChanges();
  
  
          return View("AddToMeeting", model);
      }
  
      public ActionResult AddTempTime(DateTime Start, Meeting meeting)
      {
          TempTimes.Add(Start);
          meeting.Times = TempTimes;
          return View("CreateMeeting", meeting);
      }
  
      public ActionResult ChooseTimes()
      {
          var userName = User.Identity.Name;
          var user = db.Users.Where(u =&gt; u.UserName == userName).SingleOrDefault();
          Meeting meeting = new Meeting();
  
          foreach(var item in db.Meetings)
          {
              if(item.Invited.Contains(user))
              {
                  meeting = item;
              }
          }
          return View(meeting);
      }
  </code></pre>
  
  <p>This is my Meeting model.</p>
  
  <pre><code>    public class Meeting
  {
  
      public int Id { get; set; }
      public string Title { get; set; }
      public ApplicationUser Creator { get; set; }
      public ICollection&lt;ApplicationUser&gt; Invited { get; set; }
      public double Minutes { get; set; }
      public DateTime Start { get; set; }
      public DateTime End { get; set; }
      public ICollection&lt;DateTime&gt; Times { get; set; }
      public bool AllDay { get; set; }
  
      public ICollection&lt;ApplicationUser&gt; User { get; set; }
      public ApplicationUser UserNotis { get; set; }
  
  }
  </code></pre>