public ActionResult Edit(int Id) { var item = _blogCategoryService.GetBlogCategoryById(Id); var list = _blogCategoryService.GetBlogCategories().ToSelectListItems(int.Parse(item.CategoryParentId.ToString() == "" ? "0" : item.CategoryParentId.ToString())); //BlogCategoryFormModel model1 = Mapper.Map<BlogCategory,BlogCategoryFormModel>(item); var blogCategory = Mapper.Map <BlogCategory, BlogCategoryFormModel>(item); blogCategory.ListCategory = list; return(View(blogCategory)); }