public ManufacturerGetByIdWithDetail ( int id ) : |
||
id | int | |
return |
public ManufacturerWithDetail ManufacturerGetByIdWithDetail(int id)
{
var o = ds.Manufacturers.Include("Country").Include("Vehicles")
.SingleOrDefault(m => m.Id == id);
return Mapper.Map<ManufacturerWithDetail>(o);
}
// GET: Manufacturers/Details/5 public ActionResult Details(int?id) { // Attempt to get the matching object var o = m.ManufacturerGetByIdWithDetail(id.GetValueOrDefault()); if (o == null) { return(HttpNotFound()); } else { // Pass the object to the view return(View(o)); } }