This file contains hidden or 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
namespace WebApiModuleHelloWorld | |
{ | |
using Superscribe.Models; | |
public class HelloWorldModule : Superscribe.WebApi.Modules.SuperscribeModule | |
{ | |
public HelloWorldModule() | |
{ | |
this.Get["/"] = _ => "Hello World!"; |
This file contains hidden or 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
using System.Web.Http; | |
namespace WebApiModuleHelloWorld | |
{ | |
using Superscribe.WebApi; | |
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ |
This file contains hidden or 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
namespace WebApiModuleHelloWorld | |
{ | |
public class HelloWorldModule : Superscribe.WebApi.Modules.SuperscribeModule | |
{ | |
public HelloWorldModule() | |
{ | |
this.Get["/"] = _ => "Hello World!"; | |
} | |
} | |
} |
This file contains hidden or 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
public class SampleModule : Nancy.NancyModule | |
{ | |
public SampleModule() | |
{ | |
Get["/"] = _ => "Hello World!"; | |
} | |
} |
This file contains hidden or 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
namespace BrainFuckContinued | |
{ | |
using System; | |
using System.Collections.Generic; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var p = "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>."; |
This file contains hidden or 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
// Button click function | |
model.getData = function () { | |
var skip = model.pageSize() * (model.currentPage() - 1); | |
$.get("/api/values?$top=" + model.pageSize() + "&$skip=" + skip + "&$inlinecount=allpages", function (data) { | |
model.count(data.Count); | |
model.records(data.Results); | |
}); | |
}; |
This file contains hidden or 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
// Define the viewmodel | |
var model = {}; | |
model.records = ko.observableArray(); | |
model.count = ko.observable(0); | |
model.currentPage = ko.observable(1); | |
model.pageSize = ko.observable(5); | |
model.pages = ko.computed(function () { | |
var pages = []; |
This file contains hidden or 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
<div id="body"> | |
<section class="featured"> | |
<div class="content-wrapper"> | |
<hgroup class="title"> | |
<h1>Paging with Linq to Querystring</h1> | |
</hgroup> | |
<p> | |
Look how easy it is to page data with OData and Linq to Querystring! | |
</p> | |
</div> |
This file contains hidden or 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
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
var xmlFormatter = config.Formatters.XmlFormatter; | |
config.Formatters.Remove(xmlFormatter); | |
config.Routes.MapHttpRoute( | |
name: "DefaultApi", | |
routeTemplate: "api/{controller}/{id}", |
This file contains hidden or 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
namespace LinqToQuerystringPagingSample.Controllers | |
{ | |
using System.Linq; | |
using System.Web.Http; | |
public class ValuesController : ApiController | |
{ | |
// GET api/values | |
public IQueryable<string> Get() | |
{ |