Sending data from a resource to a view in a strongly-typed, but syntactically lightweight manner is not possible with C# or VB.NET.
So check out this screencast of the new "render" macro in NRest!
In a nutshell, my resource looks like:
[Resource("")]public class RootResource{ public Get() : void { def test = 42; render (Foo = "Hello", Bar = "World", test); }}
My VB.NET view looks like:
Public Class RootPage Inherits Page(Of RootPageContent)
Public Overrides Function GetHtml() As XElement Return _ <html> <body><%= Content.Foo %>, <%= Content.Bar %></body> </html> End Function End Class
The RootPageContent DTO class is generated at compile time by the render macro. Everything is strongly-typed. Sunday, July 13, 2008 2:27:17 PM (GMT Standard Time, UTC+00:00) Comments [0] .net | dsl | macro | nemerle | nrest | REST | web
Remember Me
© Copyright 2008 Andrew Davey Theme Design by Bryan Bell newtelligence dasBlog 1.9.6264.0 | Page rendered at Wednesday, August 20, 2008 8:15:11 AM (GMT Standard Time, UTC+00:00) Pick a theme: BlogXP calmBlue Candid Blue dasBlog Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream