// GET: Admin/ProductType/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductType productType = await db.Database.SqlQuery <ProductType>("select * from producttype where id=@p0", id).SingleOrDefaultAsync(); if (productType == null) { return(HttpNotFound()); } var model = await productType.Convert(db); return(View(model)); }