Exemple #1
0
        private List <Person> AddPersons(CodeCamperDbContext context, int count)
        {
            var persons = new List <Person>();

            AddKnownAttendees(persons);
            TheChosen.AddPersons(persons);
            AddTheCrowd(count, persons);
            persons.ForEach(p => context.Persons.Add(p));
            context.SaveChanges();
            return(persons);
        }
Exemple #2
0
        // TODO: We never use this methods
        // but let's keep it here just in case.
        private List <Session> AddSessions(
            CodeCamperDbContext context,
            IList <Person> persons,
            IEnumerable <TimeSlot> timeSlots,
            IList <Track> tracks)
        {
            var slots = timeSlots.Where(t => t.IsSessionSlot).ToArray();

            var knownSessions = TheChosen.AddSessions(
                slots, tracks, _levels, _roomsForWellKnownSessions);

            var sessions = new List <Session>(knownSessions);

            AddGeneratedSessions(sessions, persons, slots, tracks);

            // Done populating sessions
            sessions.ForEach(s => context.Sessions.Add(s));
            context.SaveChanges();

            return(knownSessions);
            // return sessions;
        }