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(); //} }
public ActionResult Edit(User user) { user.UserId = MediaSwap.Web.Models.MediaSwapIdentity.Current.Id; if (ModelState.IsValid) { IUserService.SaveUser(user); } return View("Index",user); }
public ActionResult Create(User user) { if (ModelState.IsValid) { Session["SignupProfile"] = user; } return RedirectToAction("Authenticate"); }