Join Richard Goforth for an in-depth discussion in this video How to use the exercise files, part of Practical Application Architecture with Entity Framework Core.
- [Instructor] To illustrate the architectural concepts in this course, I've created a demo application against an HPlusSports database. I will be using Visual Studio 2017 on Windows to run the application. But it is possible to run the application and to follow along on Mac or Linux as well. If you are in another OS, the IDE will be different, and hosting the SQL database will be different. If you have access to the exercise files, you can follow along with me throughout the course. I've saved the files to the desktop, you can save them wherever you like.
Inside the exercise files, there's a folder for each chapter. And inside that, a folder for each video. In videos, where we change code, there will be a start and completed folder, containing a Visual Studio Solution that I will be working from. In chapters that don't, there will just be a start folder. Open up the start folder for the video you are watching, and open up the solution file in the HPlusSports folder. To run the application, first we need to create the database, and run the SQL script in the root folder, which is under solution items in Visual Studio.
I'm going to do that within Visual Studio with SQL Express, but any SQL server will work, just ensure that you update the connections string, in appsettings.json in the web project, to match the database that you set up. To use SQL Express with Visual Studio, first go to view, and down to SQL server object explorer. Under SQL server, you'll find local DB, MSSqlLocalDB. Open up databases, and right-click, "Add New Database." Name it, "HPlusSports." Now that we have a new empty database, we can open up the SQL script and run it against that database.
Click on the connection icon here to connect to the database. Select, "Local MSSqlLocalDB," and drop down the database name to HPlusSports. Quick connect. Now that script is connected to that database. We can hit the green arrow to execute the script. You can probably use the same database throughout the course, but you can always delete and recreate it to get back to the initial state. Let's run the application and see if it works.
Let's take a quick tour of the application so that it's easier to follow along during the course. It is an ASPNet core web application for a customer service rep at HPLusSports. It's not meant to be a complete application, but rather has a couple features that cross-cut all of the application layers, to illustrate architecture with Entity framework. However, to illustrate several different concepts, it has a few different ways to go about certain tasks, that would be better to keep consistent in a real application, rather than copy the architecture from this application when building a new application.
Choose the patterns and layers that make sense, and take them piecemeal. The home page is just this empty, "Hello," but if I click on "Orders," I can see a list of orders in my database. If I click on a customer, I can see all the orders from just that customer. And if I hit, "Create New," under orders, I can create a new order, by selecting a customer, a salesperson, and some items. I can control-click to multi-select in this box. That should be all that you need to know, so let's get started.
- What is good application architecture?
- Real-world software and the SDLC
- Common knowledge and maintenance
- Choosing an architecture
- Design patterns with EF
- Debugging and error handling
- Architecture for the web with ASP.NET
- Designing for unit testing
- Strategies for dealing with common performance issues