Building Your First ASP.NET Core Web Application

In this hands-on course, you'll build your first fully-working MVC web application using the new ASP.NET Core MVC framework. You'll start from the blank project and finish with a site running in Azure.
Course info
Rating
(185)
Level
Beginner
Updated
Jan 28, 2017
Duration
4h 53m
Table of contents
Course Overview
Introduction
Setting up the Solution
Creating the Overview Page
Adding Data with EF Core
Designing More Pages
Adding Navigation
Ordering with the Form
Adding Client-side Functionality
Adding Security Using ASP.NET Identity
Deploying the Site to Azure
Description
Course info
Rating
(185)
Level
Beginner
Updated
Jan 28, 2017
Duration
4h 53m
Description

After 15 years of ASP.NET, Microsoft has introduced the most radical change to the framework with the introduction of ASP.NET Core. ASP.NET Core is a complete new framework in which many concepts have changed. In this course, Building Your First ASP.NET Core Web Application, you'll learn how you can build a fully working website with ASP.NET Core, Bethany's Pie Shop. First, you'll start from scratch and you can follow along to build the entire solution in a practical way. Next, you'll learn about the project structure and project files and will see how the application is built up starting from the model and the database using Entity Framework Core. Then, you'll learn about controllers, how routing is handled in ASP.NET Core, and how you'll build several views using the new tag helpers and Razor. Finally, you'll explore what Dependency Injection is and why it plays a central role in ASP.NET Core and when the app is ready, you'll deploy it to Azure. At the end of this course, you'll have built a real-life application and that will give you a solid understanding of the ASP.NET core platform. You can use the application as a starting point for your own websites you'll want to build after finishing this course.

About the author
About the author

Gill Cleeren is a solution architect, author, and trainer in mobile and web technologies. He's also a Microsoft Regional Director and MVP. He lives in Tienen, Belgium.

More from the author
GitHub Fundamentals
Beginner
4h 16m
Sep 24, 2018
Xamarin: The Big Picture
Beginner
2h 15m
Mar 28, 2018
More courses by Gill Cleeren
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Gill Cleeren and welcome to my course, Building Your First ASP. NET Core Web Application. I'm a solution architect for web and mobile projects. . Net Core is the future of the. net framework. It's where all the investment from Microsoft will got to from now on. Since its inception, about 15 years ago, this is the biggest change ever made to. net and ASP. net. In this course we are going to create together, a fully working, real world website. With the new version of ASP. net Core and MVC. Starting from filing your project all the way to the deployment of the website in Azure. Some of the major topics that you'll cover include the ASP. Net Core MVC Framework. How you can build a real application with ASP. Net Core MVC. The new features of ASP. Net Core, such as, tag helpers and view components. Working with client site script to invoke a web API. And the deployment of the website to Azure. By the end of this course, you'll know how you can build a complete web application with ASP. Net Core. And you'll also have an overview of everything that was added to the platform. Before beginning this course, you should be familiar with some basic web development skills, however, no prior ASP. Net MVC knowledge is required. I hope you'll join me on this journey to learn ASP. Net Core MVC with the building your first ASP. Net Core Web Application course here at Pluralsight.

Setting up the Solution
Hello, and welcome again to the Building Your First ASP. NET Core Web Application course here at Pluralsight. My name is Gill Cleeren and I'll be guiding you through this module. If you've watched the previous module on this course, you will already know that ASP. NET Core is a radical change compared to earlier versions of the product. In this module, I'll be showing you already some of the big changes that come with this new version, while we will be setting up the solution and the project for Bethany's Pie Shop, so by the end of the module, you'll understand how ASP. NET Core MVC projects are structured, and configured, and you'll also understand the goal of the different files in an ASP. NET Core MVC project. It's a good tradition to start a module with an overview of what exactly you'll be learning and doing in this module; since this module is named Setting up the Solution, I'm going to start by doing exactly that. We'll be starting from file, new project, and next we'll take a look at what is being generated; I will guide you through the project structure, explaining you the important files and how they are used in ASP. NET Core. This new version offers a very flexible way to configure the application; previously, when talking about configuration, we immediately thought of a config file. Those days are gone, you'll learn how we can do the basic configuration of our site so that we can start adding pages in the next module. Let's dive in, shall we?

Creating the Overview Page
Hello, and welcome again to this Pluralsight course, where we are building together our first ASP. NET Core MVC application. I'm still Gill Cleeren, some things never seem to change, isn't it? We have, in the previous module, prepared the solution for our application, and we're now ready to start adding pages to the site. In this very module, we are going to do exactly that. We are going to create the overview page. So at the end of the module, you have already a good understanding of how you can create new pages in an ASP. NET Core MVC site. Of course, before we start with the actual work, let's take a look at what, exactly, I will be explaining you in this module. First, a short word about the MVC pattern is in place. If you don't know what this pattern stands for, I'll give you the information you need right here. Then, we are going to create the page from, well, let's say, the bottom of the stack, all the way up to the actual view. So we'll start with the lowest items in the stack. We are going to start with the creation of the model, then the repository, and then the controller. After that, we are going to create the view. I'm not only to create the view, but you'll also understand how views are matched with the controller. And finally, I'll also add some styles to our site. Our site will be basing its layout on Bootstrap, and we'll see how we can add this in an ASP. NET Core application. This is going to be a very rewarding module, since you'll be able to run your site by the end of this module, and actually see the result of your hard work.

Adding Data with EF Core
Hello, and welcome again to the Building Your First ASP. Net Core MVC Application Course here on Pluralsight. I'm Gill Cleeren and I have the pleasure to guide you through this module as well. The last module, a pretty long one I must admit, has allowed us to create already one good looking page. However, as you hopefully remember we have built a repository on top of mock data. We have been using a hard coded list of pies to visualize in our view. In this module, we are going to change that. I'll be adding a real database and I'll be making changes to the repository so that it will now use the database as well. For this we will be using the Entity Framework. And since we are working with. NET Core, of course, I will be making use of the Entity Framework Core, also known as EF Core. As always, let's start by taking a look at what we are going to cover in this module. Just as a quick introduction, I'm going to give you the basics of Entity Framework SORM. As well as introduce you to EF Core. So diversion that we will be working with in this course. Next, we will learn how we can add support for EF Core in our application. After this topic we'll have EF Core included as well as made changes to our repository. Our pie overview page will then display the same information as before, but now coming from a database. Finally, we'll learn how we can cope with model changes using migrations as well as how we can load some initial data into our database when starting the application for the very first time.

Designing More Pages
Hi there! Welcome again to my Pluralsight course, Building Your First ASP. NET Core Web application. I'm Gill Cleeren. And if you have any questions about this course, don't hesitate to contact me via Twitter, or send me an email. In the last module, we have updated our application, so that it's not actually a real database backed by EF Core. But our application is still pretty limited, isn't it? It just contains one single page, the List Overview page. But in this module, I'm going to add quite a bit of functionality and other pages. Fasten your seatbelt, by the end of this module, you'll have a much more extended version of Bethany's Pie Shop ready. Let's dive in. Let me give you an overview of what you'll be learning in this module. We'll start with learning about partial views, and we'll use these in the Pie Overview page. Next, we'll be adding a shopping cart to our site. This means that we'll have to add the Shopping Cart View, but we'll also have to make some model changes using migrations we've already seen in the previous module. Next, I'll introduce you to the new view components in ASP. NET Core. We'll build a view component that works to gather with the shopping cart. And while we're doing that, we'll also add the landing page for the website that uses this view component. Finally, we'll take a look at the creation of a custom tag helper, and we'll use this for the About page.

Adding Navigation
Hello, and welcome to another module in the Building Your First ASP. NET Core Web Application course here on Plural Site. My name is still Gill Cleeren. I think I'm going to keep it like that for the remainder of the course. If you have any questions about this course, please feel free to contact me or post your questions on the discussion board here on the Plural Site website. In the last module, we have been adding quite a few pages, but there was one problem. We can't really navigate between the different pages. Navigation on a website is a pretty common thing. So I guess the time has come to see how we can add navigation to our site. By the end of this module, we'll have a menu in our application that allows us to do navigation from one page to another, and it will also have added navigational elements throughout the pages we have already created. The overview for this module is pretty short. First, I'm going to start by explaining you the most fundamental concepts around ASP. net core MVC's routing. After we've seen the options that the routing engine in ASP. net core MVC is offering us, we'll go ahead and apply this in our application in one large demo.

Ordering with the Form
Hi there, and good to see you back here for yet another module of the Building Your First ASP. NET Core Web Application here on Pluralsight. Our site is not looking great. At the end of the last module, we've included navigation and a menu, and it's now starting to look like a real site. I'm pretty happy already with the result, and if you've been following along, I hope you are happy too. In this module, we are going to be focusing on just one screen, the order form. That intention probably was already clear to you when you looked at the title of this module. Let's start by taking a look at the overview of this module and what you will be learning. The order form is quite logically a form. With the dawn of ASP. NET MVC Core, a lot of novelties were introduced that we can use in combination with HTML forms. And in that area, I'm talking about tag helpers. I wasn't lying when I said that tag helpers were an important asset in the newer version of ASP. NET, and this is already the third time that we're encountering them in this course. So, I hope you believe me now. When we will have created the form, we'll also look at how we can add validation to the model and we'll see how we can improve the form so that the validation rules will kick in when the user has entered invalid data.

Adding Client-side Functionality
Hello, and welcome again to this Building Your First ASP. NET Core Web Application course. I'm Gill Cleeren. That's still the same as it was in the last module. We have now already a nicely implemented server-side functionality in our web application. The site looks great already. In this module, we are going to switch gears a bit. I'm going to show you how we can in ASP. NET core, MVC, work with client-side functionality. We'll be calling server-side functionality from the client side, and to do that, we'll have to make some changes on the server side, as well. Let's start the module again by taking a look at what you will be learning in this module. Doing client-side stuff in ASP. NET core will typically require that we'll be using some client-side libraries, such as jQuery. That's exactly what we'll be doing in the first part of this module. I'll be showing you the best way to add libraries to our project, and we'll again be using Bower. When we have added a library through Bower, and that'll be jQuery by the way, we'll also need to be able to invoke an action method from the client-side code. In the second part of this module, I'll be showing you how we can create an API controller, which doesn't return HTML, but instead, returns data in the form of JSON. After finishing this module, you will have seen how to make your site more interactive and responsive through client-side scripts and an API controller. Let's get started.

Adding Security Using ASP.NET Identity
Hi there, and welcome to this module in the Building Your First ASP. NET Core Work Application on Security. I'm Gill Cleeran, and you can contact me via Twitter using @gillcleeren. Let me know if you have any questions about this course. Our application is now pretty feature rich, but it currently has one big issue. If you think back of when we were creating the order form, we didn't have to login to place an order. I don't think it's wise to put an application online like that. In this module, we are going to add some security related features to the site for guest authentication and authorization. Let's start by exploring what you will be doing in this module. When we want to authenticate users or when we want to authorize users to execute certain actions within our site, we will be working with the ASP. NET Core Identity platform. To kick off the module, I'm going to give you an overview of what ASP. NET Core Identity can do for us. Next, we will be starting to add Identity to our site. At this point in the course, it shouldn't be a surprise that we'll need to do some configuration to add Identity to our application, and once configured, we can start using it. So, we'll create a login page where users will have to login before they can place an order. And we'll finally be adding authorization as well, so that we can deny certain actions in our users to non-logged in users. I hope this sounds interesting to you. Let's do this.

Deploying the Site to Azure
Hello, and welcome to the last module of the Building Your First ASP. NET Core Web Application course here on Pluralsight. Time flies when you're having fun, isn't it? It's already the last module. In this last module, we are going to make Bethany very happy. Our hard work has paid off and the site is ready, ready to be shown to the world, so she start can selling her fantastic pies to her customers all over the world. Of course, before everyone can browse Bethany's pie shop, we need to deploy the site a server for everyone to enjoy it. Because we're convinced that there will be a lot of traffic on her site, we'll need the scalability of the Cloud, so we will deploy the site to Azure, and remember. NET Core was built with the Cloud in mind, so the match between our ASP. NET Core site and Azure will be a good one. Let us start this last module like we've done with all others so far in this course, that is, by looking at the module overview. This last module is actually pretty concise, but nonetheless, it'll teach us how we can deploy the site to Azure in the correct way. I will start by explain you the support you are getting in ASP. NET Core to work with different environments. I will then explain the different options, let's say at least the most important ones that are available to us to deploy our application and make it available publicly. Finally, we'll round up the module by doing the actual deployment of the site to Azure, more specifically, I'll be deploying the site to an Azure app service. Let's get started.