Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Created June 26, 2011 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodejunkie/1048019 to your computer and use it in GitHub Desktop.
Save thecodejunkie/1048019 to your computer and use it in GitHub Desktop.
Default view location conventions in Nancy
private static void ConfigureViewLocationConventions(NancyConventions conventions)
{
conventions.ViewLocationConventions = new List<Func<string, object, ViewLocationContext, string>>
{
(viewName, model, viewLocationContext) => {
return string.Concat("/", viewName);
},
(viewName, model, viewLocationContext) => {
return string.Concat("/views/", viewName);
},
(viewName, model, viewLocationContext) => {
return string.Concat("/views", viewLocationContext.ModulePath, "/", viewName);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment