예제 #1
0
 public ActionResult Create(ProductTagModel model)
 {
     if (ModelState.IsValid)
     {
         var entity = model.MapTo <ProductTag>();
         _tagService.InsertTag(entity);
         return(RedirectToAction("List"));
     }
     return(View(model));
 }
예제 #2
0
        public ActionResult Edit(ProductTagModel model)
        {
            if (ModelState.IsValid)
            {
                var entity = _tagService.GetTag(model.Id);

                if (entity.TagImage != model.TagImage)
                {
                }

                entity = model.MapTo <ProductTag>();
                _tagService.UpdateTag(entity);
                return(RedirectToAction("List"));
            }
            return(View(model));
        }
예제 #3
0
 public static ProductTag ToEntity(this ProductTagModel model, ProductTag destination)
 {
     return(model.MapTo(destination));
 }
예제 #4
0
 public static ProductTag ToEntity(this ProductTagModel model)
 {
     return(model.MapTo <ProductTagModel, ProductTag>());
 }