Esempio n. 1
0
        public ActionResult Create(CategoryViewModel model)
        {
            var category = new Category();

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

            Session.Save(category);

            return RedirectToAction("Index");
        }
Esempio n. 2
0
 internal void UpdateEntity(Product product, string userName, Category category)
 {
     product.Name = Name;
     product.UserName = userName;
     product.Category = category;
 }
Esempio n. 3
0
 internal void UpdateEntity(Category category, string userName)
 {
     category.Name = Name;
     category.UserName = userName;
 }
Esempio n. 4
0
 public CategoryViewModel(Category category)
 {
     Id = category.Id;
     Name = category.Name;
 }