Exemplo 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");
        }
Exemplo n.º 2
0
 internal void UpdateEntity(Product product, string userName, Category category)
 {
     product.Name = Name;
     product.UserName = userName;
     product.Category = category;
 }
Exemplo n.º 3
0
 internal void UpdateEntity(Category category, string userName)
 {
     category.Name = Name;
     category.UserName = userName;
 }
Exemplo n.º 4
0
 public CategoryViewModel(Category category)
 {
     Id = category.Id;
     Name = category.Name;
 }