public void Add(BrainStormSession session)
        {
            int maxId = 0;

            if (_dbContext.BrainStormSessions.Any())
            {
                maxId = _dbContext.BrainStormSessions.Max(s => s.Id);
            }
            session.Id = maxId + 1;
            _dbContext.BrainStormSessions.Add(session);
            _dbContext.SaveChanges();
        }
        private BrainStormSession GetTestSession()
        {
            var session = new BrainStormSession()
            {
                DateCreated = new DateTime(2016, 7, 2),
                Id          = 1,
                Name        = "Test One"
            };

            var idea = new Idea()
            {
                Name = "One"
            };

            session.AddIdea(idea);
            return(session);
        }
 public void Update(BrainStormSession session)
 {
     _dbContext.Entry(session).State = EntityState.Modified;
     _dbContext.SaveChanges();
 }