public ActionResult Create(ProductTagModel model) { if (ModelState.IsValid) { var entity = model.MapTo <ProductTag>(); _tagService.InsertTag(entity); return(RedirectToAction("List")); } return(View(model)); }
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)); }
public static ProductTag ToEntity(this ProductTagModel model, ProductTag destination) { return(model.MapTo(destination)); }
public static ProductTag ToEntity(this ProductTagModel model) { return(model.MapTo <ProductTagModel, ProductTag>()); }