Q&A
Advanced ASP.NET Core
While many development conferences feature introductory sessions on various topics, more advanced tutorials are comparatively rare.
Going beyond the many "hello world" presentations out there, expert developer and presenter Chris Klug specializes in sharing his higher-level knowledge on topics that include one of his favorites: Microsoft's ASP.NET Core framework for web development.
He's going to do just that in November at the Visual Studio Live! developer conference in Orlando, part of the big umbrella conference, Live! 360.
"Instead of covering the basics of how to get up and running, this talk will have a look at some of the more ... how to put it ... complex areas of ASP.NET Core," Klug said. "Instead of looking at how you build a basic Hello World website, it looks at things like building custom middlewares and model binders, how we can do URL rewriting and run background tasks."
Attendees will get no introduction to ASP.NET Core or "this template includes ..." discussion, but rather will quickly jump right into the deep end to expand their knowledge of some of the more advanced abilities built into the framework.
Specifically, they are promised to learn:
- That there is more to ASP.NET Core than MVC
- The extension points we can use to build better or simpler solutions
- To see something out of the ordinary
We caught up with Klug to learn more about his session, which is titled "ASP.NET Core Beyond the Basics."
VisualStudioMagazine: With many "getting started" talks on ASP.NET Core already available, what inspired you to delve deeper into its more complex areas and provide this higher-level insight?
Klug: I just found that there were a lot of these introductory talks, which I do a lot of myself to be honest, but very few deep dive sessions on common technologies like ASP.NET Core. And as an experienced developer, that means that it can be a bit hard to pick up some really good new information when attending conferences. So, I thought that these people might be interested in a deeper look at the technology that they are working with.
Many developers might be acquainted with the basics, such as MVC in the ASP.NET Core framework. But you mentioned that there's more to it than just MVC. Can you shed some light on what participants might discover beyond this standard approach?
Yeah, so, most developers look at ASP.NET Core as just ASP.NET MVC. However, it is actually a framework that can do a lot of things.
"Most developers look at ASP.NET Core as just ASP.NET MVC. However, it is actually a framework that can do a lot of things."
Chris Klug, Developer, Active Solution
You can for example create background services that run parallel to your web application. You can load and execute code during start up. You can manipulate incoming requests, and create responses, using middlewares. Being able to respond to requests using an MVC controller and a view is just a part of what you can do. An important part, but still just a part.
Two topics you'll cover include building custom middlewares and model binders. Can you give us a teaser on the significance of mastering these elements and how they might impact the performance and functionality of a web application?
So, being able to plug into the request pipeline by building middlewares gives you a whole lot of power. There is so much you can accomplish by doing this, that can be hard to do in other ways. And with HttpContext being read/write in .NET Core, you can do some really interesting things.
As for the model binding, it is a bit more specific to some scenarios. But you can for example send more complex data from the client, and have it aggregated and presented as a custom model in ways that regular model binding cannot do. Something that can be really helpful in some scenarios.
With a focus on extension points and building more robust solutions, could you provide an example of a situation where utilizing an extension point in ASP.NET Core led to a significant improvement in the development process or application performance?
For this, I'll come back to the middlewares again, since I think that is the most obvious and powerful extension point. As a middleware can read and manipulate any request coming in or going back to the client, it can do so many things. It can handle custom authentication scenarios. Path re-writes. Reverse-proxying of certain paths. And so much more. An example that I use it for is the ability to reverse-proxy front-end applications during development. That means that during development I can run my ASP.NET application, and API as usual, but serve up the React of Angular front-end by proxying those calls to the Webpack server that those frameworks use during development. This means that I can sit and actively work on the front-end without having to restart the application whenever I have made a change. This makes the development cycle a lot faster for me. And in production, we package up the application and serve it from the wwwroot folder as usual. This would have been really hard to handle without middlewares (and Yarp).
What are some of the new or upcoming features or improvements in ASP.NET Core that you are most excited about, and how do they enhance your development experience or performance?
It's not really an ASP.NET thing, but I really like the way that they have made Project Orleans slot into ASP.NET Core by building it on top of IHost. And even if that isn't really an ASP.NET thing as such, it does allow us to run Project Orleans silos inside of our ASP.NET application and utilize the actor pattern model in our web applications. This is something that I think can open up a lot of really interesting capabilities.
Note: Those wishing to attend the conference can save hundreds of dollars by registering early, according to the event's pricing page. "Save up to $400 if you register by September 22!" said the organizer of the event, which is presented by the parent company of Visual Studio Magazine.
About the Author
David Ramel is an editor and writer at Converge 360.