A deep understanding of the Razor View Engine enables you to build better MVC Applications. Many developers become comfortable with the general syntax of Razor, but are unaware of the full depth of features it has to offer. This course, ASP.NET Core Razor Deep Dive, will help to fill those knowledge gaps with a rich understanding of Razor's full potential. You'll start by becoming comfortable with core concepts like Views, Layouts, and Helper Methods. You will also discover the new capabilities provided by Razor in .NET Core, such as View Components and Tag Helpers, as well as the great features from past versions that are still part of this latest release. Once you're comfortable working with Razor, you'll learn more advanced techniques like how to extend and customize Razor, how to implement Dependency Injection, and how to utilize templating. By the end this course, you'll understand the full set of features Razor offers to help build MVC applications, and feel comfortable applying them to your own future applications.
Alex Wolf is passionate about software development and mastering new technologies. He has several years of experience working almost exclusively with the .NET Framework and related platforms. Alex is also a Microsoft Certified Professional in both MVC Application development and HTML 5 technologies. He loves learning new things!
Course Overview Hi everyone, my name is Alex Wolf and welcome to this course ASP. NET Core Razor Deep Dive. I've been working with. NET MVC and Razor since their inception, so I'm excited to present this course on some of the latest and greatest features it has to offer. Razor provides a powerful productivity tool set for working with MVC applications. Many developers become comfortable with the general syntax of this view engine, but are unaware of the full depth of features it has to offer. The goal of this course is to fill those gaps with a rich understanding of Razor's full potential. Now Razor has experienced some significant changes in. NET core. The best features from past versions are still around, but many powerful new capabilities have been added as well. We'll be sure to cover all of these tools by working with an approachable sample application. Whether you're just getting started with Razor or looking to deepen your knowledge, you're in the right place. Some of the major topics that we'll cover include core concepts, like views, layouts, and helper methods. We'll also explore the powerful new View Components feature, as well as how to get started with the new Tag Helper syntax. Together we'll see how to extend and customize Razor and work with more advanced topics like dependency injection. By the end of this course, you'll understand the full set of features Razor offers to help build. NET Core MVC applications. You'll gain a deeper understanding of existing Razor features and feel comfortable exploring the new tools it offers for your future applications. Now before starting the course, you should be familiar with basic web languages, like HTML and CSS, a basic working knowledge of the. NET framework is also very useful. Of course, any MVC specific knowledge will also help, but is not required. So I hope you'll join me on this journey to really mastering Razor with this course ASP. NET Core Razor Deep Dive, right here on Pluralsight.
Building Better Forms with Razor In this module let's focus on creating forms with the Razor view engine. Razor offers an extensive set of features built around forms that are designed to really improve productivity. Building effective form workflows also requires some understanding of other MVC components, so we'll be sure to explore those topics as necessary. We'll start by discussing how forms integrate with models in MVC. This relationship is important for creating strongly typed views and setting up effective model binding for our form submissions. We'll then build our first form using these concepts. Model binding is one of the most powerful features of MVC, so we'll be sure to spend time thoroughly exploring how it works and walk through an example of that as well. In order to guarantee the integrity of our forms for both the user and the application itself, we'll also spend time in form validation. This will include how to check for and display errors on the client side, as well as how to secure our application on the server side. Finally, we'll also look at more advanced model binding scenarios with collections and see how MVC handles these types of data structures. This module we'll really start to go deeper into Razor, so let's get started in the next clip.
Building for Reusability with View Components Hi there, I'm Alex Wolf, and in this module we want to discuss view components in MVC Core. View components are one of the most significant new features in the latest version of Razor. They can really impact the way you structure the views and logic of your application. We'll being this discuss by exploring partial views, which provide the basic building blocks for view components. We'll also see how this useful feature of Razor can improve the organization of our application. We'll then explore the evolution of partial views by delving into view components. What functionality can view components offer and how do they compare to legacy features of Razor, like child actions. Once we understand these essential concepts, we can build our first view component. There are many different implementations and use cases for these components, but we'll cover some of the most productive and common ways to utilize them. After we have a working view component, we want to explore the benefits this provides to our application. So we'll see an example of how our component provides reusability and how to add parameters to customize how it displays. We'll also step through a demo of how view components provide isolation to protect the other layers of our application. Finally, we'll work with a more advanced view component example. This component will demonstrate how to handle user interaction through Ajax and even integrate with a controller. The best way to learn how to build view components is by working hands on with different types of examples, so let's move ahead in this process in the next clip.
Working with Dependency Injection in Razor Hi there, I'm Alex Wolf and in this module we want to explore how dependency injection integrates with Razor and MVC Core. The larger. NET Core platform features strong support for this design pattern and learning to work with it can improve the code quality of your applications. Now if you aren't familiar with dependency injection, there's no need to worry. This module will provide a high level introduction to the important concepts. As long as you understand the benefits of DI and how it integrates with Razor by the end of this module, you'll be just fine for the purposes of this course. So we'll begin this module with an overview of the core concepts of dependency injection. This will include understanding why we need dependency injection and the benefits it can provide to your application. Once we're on the same page conceptually, we'll see how to empower one of our view components with dependency injection. We'll also add DI to a second view component in order to illustrate some of the concepts around managing object lifetimes through containers. We will also discuss how to use dependency injection directly inside of views. Now adding business logic to your views is a concept that should be approached with caution, but we'll discuss when it might be appropriate and look at a possible use case for this. Finally, we'll step through a quick example of how to replace the built in. NET Core dependency injection features with third party options. We have our work cut out for us in this module, so let's get started with an overview of dependency injection in the next clip.
Extending and Configuring Razor Hello again, I'm Alex Wolf, and in this module let's explore how we can extend and configure the Razor view engine. Razor is powerful and flexible, but there are many cases when the built in functionality doesn't provide exactly what you need. Fortunately Razor is designed with these situations in mind and offers several extension points that can help to fill these gaps. So we'll start by continuing our progress with tag helpers from the previous module by discussing the flexibility offered by custom tag helpers. Authoring tag helpers is a fairly expansive topic, but we'll get started with a simple example of a custom helper that can be applied as an attribute on existing HTML. We'll also explore a second custom tag helper that introduces a few other concepts, like creating entirely custom HTML elements. HTML helpers also offer this type of customization, so we'll see how we can customize them to improve the markup in our views or compensate for missing functionality. Once we understand how to extend HTML and tag helpers, we want to dive deeper into the internals of the view engine itself. We'll first explore in more depth just what a view engine is and then we'll see how we can customize the way it searches for views. We'll also spend a bit of time looking at Razor under the hood to better understand how it compiles and renders views. This module covers a variety of interesting topics that can take your Razor skills to the next level, so let's get started in the next clip.
Creating Efficient Markup with Razor Templating Hi, I'm Alex Wolf and in this module we're going to learn about the templating features provided by Razor. Templates are another feature that can provide code reusability and help keep your Razor views clean. A major component of templating is metadata, so we'll also be revisiting the models of our application to see how we can optimize them for our Razor code. So first we'll begin with a discussion of the templating options offered by Razor and some of the high level concepts behind them. We'll then work on implementing our first templated HTML helpers and see what kind of impact this has on our views. We'll also see how we can override some of the built-in templates that Razor uses when rendering your model properties. You can also create templates for custom classes and data types in your application, so we'll explore a useful example of that as well. Additionally, Razor offers options for creating more miscellaneous templates that you could use for your own specific situations. We'll then see how we can use model level templates that provide advanced scaffolding options for our views, which can drastically reduce our markup. Finally, we'll also look at how to apply metadata on auto generated classes from technologies like Entity Framework, so you understand how to leverage templating in a variety of scenarios. Let's get started in the next clip with a high level discussion of essential templating concepts.