Last active
December 15, 2015 09:39
-
-
Save thinkdevcode/5240466 to your computer and use it in GitHub Desktop.
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
public class Main : NancyModule | |
{ | |
public Main() | |
: base("/v1/vision") | |
{ | |
Get["/{dbo}/{table}"] = _ => | |
{ | |
var db = Database.OpenNamedConnection("VisionDev"); | |
int page = (Request.Query.page) ? Request.Query.page : 1; | |
List<dynamic> list = db[_.dbo][_.table].All().Skip(page * 20).Take(20).ToList(); | |
return Response.AsJson(list); | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paging added and fixed a bug in simple.data.sqlserver in the process lol