Пример #1
0
 public ActionResult Create(UserItem input)
 {
     input.UserId = WebSecurity.CurrentUserId;
     using (YearnlyEntities context = new YearnlyEntities())
     {
         context.UserItems.Add(input);
         context.SaveChanges();
     }
     return RedirectToAction("index", "items");
 }
Пример #2
0
 public ActionResult Create(String listname)
 {
     UserList newList = new UserList();
     newList.Name = listname;
     newList.UserId = WebSecurity.CurrentUserId;
     newList.DateCreated = DateTime.UtcNow;
     using (YearnlyEntities context = new YearnlyEntities())
     {
         context.UserLists.Add(newList);
         context.SaveChanges();
     }
     return RedirectToAction("index", "list");
 }