static DatabaseFactory()
        {
            var db = new MemoryEventDatabase();

            ScheduledEvent e = new ScheduledEvent()
            {
                Name        = "Mom Birthday Party",
                Description = "When my mom turns 30 for the 20th time",
                StartDate   = new DateTime(2019, 10, 21, 9, 0, 0),
                EndDate     = new DateTime(2019, 10, 22, 9, 0, 0),
                IsPublic    = false
            };
            ScheduledEvent a = new ScheduledEvent()
            {
                Name        = "Aunt Grace Birthday Party",
                Description = "Dinner at Mi Cocina",
                StartDate   = new DateTime(2019, 7, 5, 3, 0, 0),
                EndDate     = new DateTime(2019, 7, 6, 9, 0, 0),
                IsPublic    = true
            };

            db.Add(e);
            db.Add(a);

            Database = db;
        }
Exemplo n.º 2
0
        private static List <ScheduledEvent> AddRange(this MemoryEventDatabase mmd, List <ScheduledEvent> evts)
        {
            List <ScheduledEvent> rtnEvents = new List <ScheduledEvent>();

            evts.ForEach(evt => rtnEvents.Add(mmd.Add(evt)));

            return(rtnEvents);
        }
Exemplo n.º 3
0
        //Static constructors are called just before the type is referenced the first time
        static DatabaseFactory()
        {
            //Create an instance of your IEventDatabase class...
            var db = new MemoryEventDatabase();

            var evt1 = new ScheduledEvent();

            evt1.Id        = 0;
            evt1.Name      = "Not Public";
            evt1.IsPublic  = false;
            evt1.StartDate = new DateTime(2019, 1, 20);
            evt1.EndDate   = new DateTime(2019, 1, 21);

            db.Add(evt1);

            evt1.Id        = 0;
            evt1.Name      = "Hello";
            evt1.IsPublic  = false;
            evt1.StartDate = new DateTime(2019, 5, 24);
            evt1.EndDate   = new DateTime(2019, 7, 20);

            db.Add(evt1);

            evt1.Id        = 0;
            evt1.Name      = "Public";
            evt1.IsPublic  = true;
            evt1.StartDate = new DateTime(2020, 1, 18);
            evt1.EndDate   = new DateTime(2020, 6, 27);

            db.Add(evt1);

            evt1.Id        = 0;
            evt1.Name      = "Unfortunate";
            evt1.IsPublic  = true;
            evt1.StartDate = new DateTime(2019, 1, 20);
            evt1.EndDate   = new DateTime(2019, 5, 22);

            db.Add(evt1);

            Database = db;
        }
Exemplo n.º 4
0
        static DatabaseFactory()
        {
            var Database = new MemoryEventDatabase();

            ScheduledEvent event1 = new ScheduledEvent()
            {
                Name        = "Twenty One Pilots Concert",
                Description = "A concert focused around the new album Trench",
                StartDate   = new DateTime(2018, 11, 7, 19, 0, 0),
                EndDate     = new DateTime(2018, 11, 7, 23, 0, 0),
                IsPublic    = false,
            };

            ScheduledEvent event2 = new ScheduledEvent()
            {
                Name        = "Family Christmas party",
                Description = "My Family's Christmas party",
                StartDate   = new DateTime(2018, 12, 24, 13, 0, 0),
                EndDate     = new DateTime(2018, 12, 24, 21, 0, 0),
                IsPublic    = false,
            };
            ScheduledEvent event3 = new ScheduledEvent()
            {
                Name        = "Rock Climbing Competetion",
                Description = "My first rock climbing competetion",
                StartDate   = new DateTime(2018, 12, 14, 18, 0, 0),
                EndDate     = new DateTime(2018, 12, 14, 23, 0, 0),
                IsPublic    = true,
            };

            Database.Add(event1);
            Database.Add(event2);
            Database.Add(event3);

            _database = Database;
        }
Exemplo n.º 5
0
        static DatabaseFactory()
        {
            eventDatabase = new MemoryEventDatabase();

            //var db = new MemoryEventDatabase();

            eventDatabase.Add(new ScheduledEvent()
            {
                Name        = "Doctor Apportionment",
                Description = "Yearly Exam",
                StartDate   = DateTime.Parse("12/15/18"),
                EndDate     = DateTime.Parse("12/15/18"),
                IsPublic    = false
            });

            //Database = db;
        }