views:

23

answers:

1

In Visual Studio when you add a new controller to your MVC application some macro creates a file with methods like:

//
// GET: /Thing/Details/5

public ActionResult Details(int id)
{
    return View();
}

I want my methods to look like:

/// <example>GET: /Thing/Details/XXX...</example>
public ActionResult Details(Guid id)
{
    return View(Repository.GetItem<Thing, Guid>(id, "Id"));
}

The main differences are standard notation for the comments with the two redundant lines removed and I use unique identifiers rather than integers for my id's. If possible, I'd like the code to pass my Model to the view to also be generated.

Is there a built in mechanism that will let me control the code template that is used?

+1  A: 

I think David Hayden has a solution for you here. Blog Post

Hope that hleps,

Dan

Daniel Elliott
Beautiful, thanks!
grenade