public ActionResult Create(CategoryViewModel model) { var category = new Category(); model.UpdateEntity(category, HttpContext.User.Identity.Name); Session.Save(category); return RedirectToAction("Index"); }
internal void UpdateEntity(Product product, string userName, Category category) { product.Name = Name; product.UserName = userName; product.Category = category; }
internal void UpdateEntity(Category category, string userName) { category.Name = Name; category.UserName = userName; }
public CategoryViewModel(Category category) { Id = category.Id; Name = category.Name; }