Exemple #1
0
        private void PopulateDB()
        {
            var firstUser = new DB.User {
                Name = "First", Email = "*****@*****.**"
            };
            var secondUser = new DB.User {
                Name = "Second", Email = "*****@*****.**"
            };

            dataContext.Users.InsertOnSubmit(firstUser);
            dataContext.Users.InsertOnSubmit(secondUser);

            var wishes = new List <DB.Wish> {
                new DB.Wish {
                    Name = "First wish", Description = "1st", Created = DateTime.Now, User = firstUser
                },
                new DB.Wish {
                    Name = "Second wish", Description = "2nd", Created = DateTime.Now, User = secondUser
                }
            };

            dataContext.Wishes.InsertAllOnSubmit(wishes);

            dataContext.SubmitChanges();
            firstUserId  = firstUser.UserId;
            secondUserId = secondUser.UserId;
        }
        private void PopulateDB()
        {
            var firstUser = new DB.User {
                Name = "First", Email = "*****@*****.**"
            };
            var secondUser = new DB.User {
                Name = "Second", Email = "*****@*****.**"
            };

            dataContext.Users.InsertOnSubmit(firstUser);
            dataContext.Users.InsertOnSubmit(secondUser);

            dataContext.SubmitChanges();
        }