Guest User

Untitled

a guest
Jul 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. namespace NancyConNegDemo
  2. {
  3. using Extensions;
  4. using Models;
  5. using Nancy;
  6.  
  7. public class ConNegModule : NancyModule
  8. {
  9. public ConNegModule() : base("/conneg")
  10. {
  11. Get["/"] = x =>
  12. {
  13. var model = new UserModel(Context.Items["username"].ToString());
  14.  
  15. I.RespondTo(ContentTypes.Html).WithView("MyView")
  16. .RespondTo(ContentTypes.Xml)
  17. .RespondTo(ContentTypes.Json)
  18. .UsingModel(model);
  19. };
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment