OSCON 2015 - Introduction to .NET Core & ASP.NET Core

  1. Acquire & install (Windows, OS X, VS, VS Code, etc.)
  2. .NET Core SDK
  3. VS Code
  4. OmniSharp plug-in
  5. VS2015 Update 2
  6. VS2015 tools Preview 1
  7. Write our first app (Hello World of course!)
  8. mkdir -> dotnet new -> dotnet run
  9. dotnet ./output.dll
  10. demo use of dotnet build/run (e.g. change file, dotnet run, builds, etc.)
  11. Turn it into Hello World web app
  12. Add kestrel package
  13. Use WebHostBuilder to boot with inline middleware to reply
  14. Add console logging so we can see what we're doing set to debug level
  15. Serve static files by adding pre-built middleware
  16. Add static files package
  17. Create wwwroot/hello.html
  18. Add an API that returns an object
  19. Add MVC package
  20. Add MVC services
  21. Add MVC middleware
  22. Add Controllers/HelloController.cs
  23. Use POSTMAN to see it come back as JSON
  24. Let's build an Attendee List app
  25. Build our model: Models/Attendee.cs
  26. Add EF for persistance
    1. Add EF in-memory package
    2. Add EF services
    3. Add Data/WorkshopContext.cs
    4. Add Attendee DbSet property
  27. Add Controllers/AttendeesApiController.cs
  28. Add Get API
  29. Use POSTMAN to call it, no result yet
  30. Add Create API
  31. Use POSTMAN to call it, create record, then query it again
  32. Use POSTMAN to use the API, create and see attendees
  33. Let's add some UI to show and delete attendees
  34. Add a TypeScript file: wwwroot/app.ts
  35. Add a tsconfig.json to the root of the project
  36. Add a reference to the
  37. Change to SQL Lite
  38. Set up configuration to flow the connection string to SQL Lite
  39. Read from appsettings.json
  40. Read from environment variables
  41. Demonstrate overriding the configuration value in the file from the environment variables
  42. Add a required attribute to the model
  43. Attempt to POST an invalid attendee and see the 500 response
  44. Add Diagnostics page middleware to show in Development environment to aid in debugging via response
  45. Set the environment to Development: ASPNETCORE_ENVIRONMENT=true env var
  46. Attempt to POST invalid attendee again and this time see error page
  47. Add some code to turn validation errors into 400 responses: BadRequest(ModelState)
  48. Preparing the app for deployment with dotnet publish
  49. Modify the app to display details of the current OS on the home page (via an API & JS call)
  50. Publish the app to a USB key (from OS X)
  51. Run the app from the USB key on another machine (e.g. on Windows)

Links

Extra topics if we have time

  • Dependency Injection
  • Server-side rendering with Razor
  • Using dotnet watch via Microsoft.DotNet.Watcher.Tools (currently broken)
  • Deploy to azure