public ActionResult Edit(int?Id) { ViewBag.SizeId = new SelectList(Context.Sizes, "Id", "Name"); ViewBag.ProductId = new SelectList(Context.Products, "Id", "Name"); if (Id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductSizes productSize = Handler.GetProductSize(Id); if (productSize == null) { return(HttpNotFound()); } return(View(productSize)); }