##Preparation:
-
Get Nuget CsvHelper
-
Copy extension method to My Extensions in LinqPad
##Usage:
- Write your query (C# Statements)
var sw = new System.Diagnostics.Stopwatch(); | |
var x = new []{"foo","bar","baz"}; | |
sw.Start(); | |
foreach(var iterations in Enumerable.Range(1,10000000)) | |
{ | |
var result = x.Aggregate ((a,s)=>a+ ", " + s); | |
} | |
sw.ElapsedMilliseconds.Dump(); |
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage | |
@{ | |
Layout = null; | |
} | |
@functions{ | |
/* | |
* Poor mans "Code First" implementation for Umbraco |
/// <reference path='ref.ts'/> | |
module app { | |
export class Main { | |
constructor(){ | |
// data context | |
var data = new app.data.Items(); | |
// initiate some client side router | |
// using backbone currently, but that's easy to change |
public class ArticlePageViewModel { | |
// use partial view "TopMenuViewModel.cshtml" | |
public TopMenuViewModel TopMenu {get;set;} | |
// use partial view "WidgetsViewModel.cshtml" | |
public WidgetsViewModel Widgets {get;set;} | |
// use partial view "ExtraWidgets.cshtml" | |
[UIHint("ExtraWidgets")] |
// Sample generation: | |
// | |
// Types in assembly: MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null | |
// Generated 01/28/2013 13:11:37 | |
// | |
module myInterfaces { | |
// | |
// Type: MyAssembly.Models.Client | |
// |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
"UmbracoContent", | |
"content/{*url}", new { controller = "Content", action = "Index" }); | |
routes.MapRoute( | |
"Default", // Route name |
@{ | |
// declare a dynamic property and attach current this to it: | |
PageData[0].Globals = this; | |
} | |
@helper Foo(string message){ | |
<p>Foo @message</p> | |
} | |
@functions{ |
<h1>About</h1> |
##Preparation:
Get Nuget CsvHelper
Copy extension method to My Extensions in LinqPad
##Usage:
module createAppLoginWidget { | |
declare var kendo; | |
declare var ui; | |
declare var $; | |
var ui = kendo.ui, Widget = ui.Widget | |
class AppLoginWidget { |