public ActionResult Create() { CF_VM cf = new CF_VM { Categories = new SelectList(db.Category.ToList(), "Id", "Name"), Furniture = new Furniture() }; return(View(cf)); }
public ActionResult Edit(int?Id) { if (Id == null) { return(HttpNotFound("Id is not found")); } Furniture furniture = db.Furniture.Find(Id); if (furniture == null) { return(HttpNotFound("Furniture is not found")); } CF_VM f = new CF_VM { Categories = new SelectList(db.Category.ToList(), "Id", "Name"), Furniture = furniture }; return(View(f)); }