コード例 #1
0
ファイル: Configuration.cs プロジェクト: duluca/ExcellaLean
        private static void SeedPersons(LeanDatabase context)
        {
            var people = new List <Person>
            {
                new Person
                {
                    Ssn            = "123456001",
                    FirstName      = "John",
                    LastName       = "Doe",
                    LastUpdateBy   = "SYSTEM",
                    LastUpdateDate = DateTime.Now,
                },
                new Person
                {
                    Ssn            = "123456002",
                    FirstName      = "Jane",
                    LastName       = "Smith",
                    LastUpdateBy   = "SYSTEM",
                    LastUpdateDate = DateTime.Now,
                }
            };

            foreach (var person in people)
            {
                context.AddUpdate(person);
            }

            context.SaveAllChanges();
        }
コード例 #2
0
ファイル: Configuration.cs プロジェクト: duluca/ExcellaLean
        private void SeedEvents(LeanDatabase context)
        {
            var events = new List <Event>
            {
                new Event
                {
                    Title               = "My Event",
                    Description         = "My Event",
                    ReservationRequests = new Collection <ReservationRequest>(),
                    ScheduledDate       = DateTime.Now,
                    LastUpdateBy        = "SYSTEM",
                    LastUpdateDate      = DateTime.Now,
                }
            };

            foreach (var evt in events)
            {
                context.AddUpdate(evt);
            }

            context.SaveAllChanges();
        }