public ActionResult Edit(long?Id) { if (Id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var entity = Dao.Detail(Id); if (entity == null) { return(HttpNotFound()); } var ouput = new ContentsModel(); ouput.CategoryId = entity.CategoryId; ouput.Content = entity.Content; ouput.Date = entity.Date; ouput.Description = entity.Description; ouput.Id = entity.Id; ouput.Meta_Description = entity.Meta_Description; ouput.Meta_Keyword = entity.Meta_Keyword; ouput.Meta_Title = entity.Meta_Title; ouput.Modified = Convert.ToDateTime(entity.Modified); ouput.Name = entity.Name; ouput.Order = entity.Order; ouput.ParentId = entity.ParentId; ouput.Slug = entity.Slug; ouput.Status = entity.Status; ouput.Taxonomy = entity.Taxonomy; ouput.Thumbnail = entity.Thumbnail; ouput.Title = entity.Title; ouput.UserId = entity.UserId; ouput.View = entity.View; ViewBag.CategoryId = new SelectList(DaoCategories.ListAllByTaxonomy("Content"), "Id", "Title", ouput.CategoryId); return(View(ouput)); }