Created
July 28, 2011 14:25
-
-
Save theClarkSell/1111636 to your computer and use it in GitHub Desktop.
Consuming an OData Service from WebMatrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Consuming an OData Service from WebMatrix</title> | |
<meta name="author" content="Clark Sell" /> | |
</head> | |
<body> | |
<div> | |
<h2><a href="http://developerSmackdown.com" target=_blank>Developer Smackdown</a></h2> | |
<p >The latest on <a href="http://developerSmackdown.com/archives/show" target=_blank>Developer Smackdown</a></p> | |
@DeveloperSmackdown.GetLatestShow() | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div> | |
<h2><a href="http://developerSmackdown.com" target=_blank>Developer Smackdown</a></h2> | |
<p >The latest on <a href="http://developerSmackdown.com/archives/show" target=_blank>Developer Smackdown</a></p> | |
@DeveloperSmackdown.GetLatestShow() | |
</div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@functions { | |
public static IList<dynamic> GetRecentShow() | |
{ | |
return OData.Get(@"http://developersmackdown.com/services/odata/Shows?$orderby=ShowId%20desc&$top=1"); | |
} | |
} | |
@helper GetLatestShow() { | |
var show = DeveloperSmackdown.GetRecentShow(); | |
<p>@show[0].Title</p> | |
<p>@show[0].Description</p> | |
<p><a href="@show[0].PublicUri" class="more">Listen Now »</a></p> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment