Razor and c# etc.

Notes on my first stab at MVC on vs2010

@ are very important.

A good quick reference for those confused about the cshtml syntax:

Call a function from the page:

@( projectname.Controllers.SpecificController.FuntionName())

Basically fully qualify the name of the function and you should be fine.
You might have to declare the function as static.


Help my VS2010 doesn’t work properly for the model section!!
“DBContext” Are you missing an assembly reference?

http://www.microsoft.com/en-gb/download/confirmation.aspx?id=1491 and include

using System.Data.Entity;

at the top of your source file/class whatever…