예제 #1
0
        public void Should_be_able_to_add_user()
        {
            //using (var scope = new TransactionScope(TransactionScopeOption.RequiresNew))
            //{
                User user = new User();
                user.FirstName = "Jeaux";
                user.LastName = "Smith";
                user.Token = "1212121";
                user.UserName = "******";
                user.Email = "*****@*****.**";

                var items = new List<Item>();
                items.Add(new Item(){ ItemName = "Test Item"});
                items.Add(new Item(){ ItemName = "Test Item 2"});

                user.Items = items;

                _context.User.Add(user);

                _context.SaveChanges();

            //    scope.Complete();

            //}
        }
예제 #2
0
 public ActionResult Edit(User user)
 {
     user.UserId = MediaSwap.Web.Models.MediaSwapIdentity.Current.Id;
     if (ModelState.IsValid)
     {
         IUserService.SaveUser(user);
     }
     return View("Index",user);
 }
예제 #3
0
        public ActionResult Create(User user)
        {
            if (ModelState.IsValid)
            {

                Session["SignupProfile"] = user;
            }

               return RedirectToAction("Authenticate");
        }