Esempio n. 1
0
        public ActionResult Create(ShoppingListViewModel model)
        {
            var shoppingList = new ShoppingList();

            model.UpdateEntity(shoppingList, HttpContext.User.Identity.Name);

            Session.Save(shoppingList);

            return RedirectToAction("Index");
        }
Esempio n. 2
0
 internal void UpdateEntity(ShoppingList shoppingList, string userName)
 {
     shoppingList.Name = Name;
     shoppingList.UserName = userName;
 }
Esempio n. 3
0
 public ShoppingListViewModel(ShoppingList shoppingList)
 {
     Id = shoppingList.Id;
     Name = shoppingList.Name;
 }