Andrew Hoefling

Speaker | Mentor | Coder | Leader

Dependency Injection is a new feature coming to DNN in 9.4 that allows you to inject abstractions or other objects into your MVC Module Controllers. This has been a common practice in both ASP.NET MVC and ASP.NET Core MVC application development. Removing the tight coupling between your controller code and business layer of your module.

Dependency Injection is used in many modern applications, it is ubiquitous across .NET application development. In .NET Core it has been built into the platform as a core feature that gets configured during the App Startup code. DNN was built before Dependency Injection became so popular in .NET, and in-lieu of Dependency Injection the Factory Pattern was heavily used. Adding Dependency Injection in DNN will be the first major step towards migrating to .NET Core.

When I first tried using Swagger with Web API I spent a little time looking through the configuration files and it seemed a little confusing to me. I did a little research and I came across Swashbuckle which makes adding Swagger UI into your Web API project a no brainer. It can hook right into your Startup Configuration class and should only take a few minutes to get the basics up and running. After learning how easy it is to setup Swagger UI in my Web API project I now spend the 5 minutes to add it in.

When you set out to create a new web application in ASP.NET you have 2 major choices:

  • MVC
  • Web API

Today we are going to take a look at creating necessary APIs for user authentication.

  • ASP.NET Core Identity
  • Authentication
  • Saving Cookies
  • Generating Tokens
  • Create Scaffolding for Web API