Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright and Credits
ASP.NET Core 2 Fundamentals
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Setting the Stage
Introduction to Web Applications
How Web Applications Work
What is the HTTP Protocol?
HTTP/2's Edge over HTTP/1.x
Request-Response Pattern
Stateless Nature of HTTP
Advantages to HTTP
Work with the Statelessness and the Request-Response Pattern
Client Side and Server Side
Programming Styles – RPC versus REST
Working with HTTP Methods
The GET Method
The POST Method
List of Important Methods
Other Methods
Activity: Working with the Request-Response Pattern
Introduction to ASP.NET
ASP.NET MVC
The Model-View-Controller Pattern
A File-Based Project
Creating Your First Project
Creating Your First Application
Summary
Controllers
Role of the Controller in ASP.NET MVC Applications
Ideal Flow of Data for a Layered Web Application
Introduction to Routing
Activity: Finding the Correct Method Invoked for a URL
Installing the ASP.NET Core NuGet Package in Your Application
Our First Controller
IActionResult
Activity: Implementing Your Own IActionResult
Adding Views
Adding Models
Passing Data from the Controller to the View
Filters
Activity: Writing a Custom Filter
Summary
Views
The View Engine and the Razor View Engine
The Razor View Engine
Programming in the Razor View Engine
Variables in the Razor View
Working with Razor View
Programming Constructs in the Razor View
Activity: Printing Prime Numbers from 1 to 100
Layout
Building our First Layout
Creating _ViewStart.cshtml
Creating _Layout.cshtml
Adding a Page-Specific View
Activity: Creating Another Layout and Changing the View to That Layout
Generating HTML
Generating HTML using a Simple Form
HTML Helpers
Generating a form using HTML Helpers
Activity: Making Use of a Checkbox
Partial View
Calling a Partial View
Activity: Working with Static Data
View Components
Creating a View Component
Creating a ViewComponent Attribute
Activity: Passing a String as Additional Data
Tag Helpers
Custom Tag Helpers
Creating a Custom Tag Helper
Activity: Replacing Email Tag Helpers
Summary
Models
Introduction to Models
Creating an ASP.NET Core Application
Models Specific to a View Component
ViewModels
Data Flow with Respect to a Model
Activity: Revising the Code to Show Discount in the Total
Model Binding
Entity Framework
Creating Console Applications with Entity Framework
Installing Entity Framework Core NuGet Package
Using the NuGet Package Manager
Installing Entity Framework Commands
Creating Model Classes
Creating the DbContext Class
Creating a Migration
How the SaveChanges Method Works
Updating the Record
Deleting the Record
Activity: Controlling the Transaction Manually
Using Entity Framework in ASP.NET MVC Applications
Database Migration
Summary
Validation
Introduction to Validation
Client-Side and Server-Side Validation
Server-Side Validation
Updating ViewModels with the Data Annotation Attribute
Updating the ViewModel to Display the Validation Error Message
Updating the Controller Action Method to Verify the Model State
Activity: Adding a New Validation Rule for Designation
Client-Side Validation
Performing Client-Side Validation
Activity: Adding a New Validation Rule to a JavaScript Function
Implementation
Activity: Adding a New Validation Rule for Designation by Extending ValidationAttribute
Summary
Routing
Convention-Based Routing
Attribute-Based Routing
Working on an Example of Attribute-Based Routing
Route Attribute at the Controller Level
Token Replacement in Route Templates
Activity: Combining Route Templates that Begin with /
Passing Routing Values in HTTP Action Verbs in the Controller
Activity: Defining Two Actions with the Same Name with Different Verbs
Route Constraints
Activity: Creating an Attribute that Implements IActionConstraintFactory
Summary
Rest Buy
Designing Rest Buy
Features and Stories
Layout and Pages
Main Page
Product Detail
Checkout
Checkout Success
Previous Orders
Defining our Domain and Model
Creating a RestBuy Project
Activity: Preparing Features and Stories for a Website
Activity: Preparing Wireframe Diagrams for a Website
Activity: Designing a Domain Model for a Website
Creating the Entities
Create EF Context and Migrations
Create migrations
Activity: Adding a Supplier Entity that Denotes the Supplier of a Product
Summary
Adding Features, Testing, and Deployment
Adding the Registration Feature
Sign In and Sign Out Mechanism
Creating the Application Layer
Performing Implementations in the Infrastructure Project
Defining our ViewModel for Registration
Defining our Controllers
Creating the Post-Registration Landing Page
Creating a Query for the Registration Service
Validating the Registration
Creating a Unit Test
Writing a Unit Test
Running the Unit Test
Activity: Writing a Unit Test for Deletion
Upgrading Our Project to Bootstrap 4
Activity: Adding a EULA Agreement
Deploying RestBuy to Azure
Signing up to Microsoft Azure
Prerequisites to Azure Deployment
Deploying Rest Buy to Azure
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
← Prev
Back
Next →
← Prev
Back
Next →