mvc3 (3)

MVC3 Retrieving the browser Url

Code Snippet Public Module MyUrlExtensions     <Extension()> _     Public Function UrlOriginal(ByVal request As HttpRequestBase) As Uri         Dim hostHeader As String = request.Headers(“host”)         Return New Uri(String.Format(“{0}://{1}{2}“, request.Url.Scheme, hostHeader, request.RawUrl))     End Function End Module

Scaffhold views/controllers within n-tier solutions. EF Code first flavour.

I’ve been struggling for a while this morning, trying to use one of the most popular MVC tools features: the ability to generate a controller with the CRUD (Create, Read, Update, Delete) actions over a model. The generator will create the different views as well. Or better.. it should =) Everything works smoothly when you […]

EF Code first with MVC 3 scaffholding.

Here’s a sample of Code first and the MVC 3 scaffholding in action, in order to run it you’ll need the MVC 3 Tools Update extension and the Nuget package for MvcScaffholding. The schema is pretty simple: Dowload the source code.