Skip to content

Instantly share code, notes, and snippets.

@sgoguen
Last active June 23, 2017 01:24
Show Gist options
  • Save sgoguen/9905f5d5b5f6ecb1e02fba0c552e8768 to your computer and use it in GitHub Desktop.
Save sgoguen/9905f5d5b5f6ecb1e02fba0c552e8768 to your computer and use it in GitHub Desktop.
Multiple File Test

A Better Way to Compose Web Applications

I don't care for the MVC pattern most of us use for building web applications. What I like about frameworks like ASP.MVC is how is automatically maps URLs to an idiomatic C# method.

public class PersonController : Controller {
  public ActionResult Get(int id) {
     return View(new { Id = id, Name = "Bob" });
  }
}

What I'd like to so instead is something more function based rather than object oriented based.

module Routing
  type Person = { Id: int; Name: string }

  let getPeople(id:int) = { Id = id; Name = "Bob" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment