Beispiel #1
0
        public virtual ActionResult EditAttribute(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var attribute = _attributeService.GetAttributeById(id.Value);

            if (attribute == null)
            {
                return(HttpNotFound());
            }

            return(View(new EditAttributeViewModel {
                Name = attribute.Name, CategoryId = attribute.CategoryId, Id = attribute.Id
            }));
        }
        public ActionResult Edit(int id)
        {
            var entity = _attributeService.GetAttributeById(id);
            var model  = entity.MapTo <AttributeModel>();

            PrepareAttributeModel(model);
            return(View(model));
        }