Return View of a model or an HttpStatusCode


        public ActionResult Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

       
            OrderNote orderNote = mymethodtoretriverecord(id);

            if (orderNote == null)
            {
                return HttpNotFound();
            }
            return View(orderNote);
        }



       

Comments

Popular posts from this blog

Linq Exclude from separate list

Sorting Ascending and Descending

Linq Query Syntax vs Method Syntax