Learning ASP.NET Core 2.0

Book description

Learn how web applications can be built efficiently using ASP.NET Core 2.0 and related frameworks

About This Book

  • Get to grips with the new features and APIs introduced in ASP.NET Core 2.0
  • Leverage the MVC framework and Entity Framework Core 2 to build efficient applications
  • Learn to deploy your web applications in new environments such as the cloud and Docker

Who This Book Is For

This book is for developers who would like to build modern web applications with ASP.NET Core 2.0. No prior knowledge of ASP.NET or .NET Core is required. However, basic programming knowledge is assumed. Additionally, previous Visual Studio experience will be helpful but is not required, since detailed instructions will guide through the samples of the book.This book can also help people, who work in infrastructure engineering and operations, to monitor and diagnose problems during the runtime of ASP.NET Core 2.0 web applications.

What You Will Learn

  • Set up your development environment using Visual Studio 2017 and Visual Studio Code
  • Create a fully automated continuous delivery pipeline using Visual Studio Team Services
  • Get to know the basic and advanced concepts of ASP.NET Core 2.0 with detailed examples
  • Build an MVC web application and use Entity Framework Core 2 to access data
  • Add Web APIs to your web applications using RPC, REST, and HATEOAS
  • Authenticate and authorize users with built-in ASP.NET Core 2.0 features
  • Use Azure, Amazon Web Services, and Docker to deploy and monitor your applications

In Detail

The ability to develop web applications that are highly efficient but also easy to maintain has become imperative to many businesses. ASP.NET Core 2.0 is an open source framework from Microsoft, which makes it easy to build cross-platform web applications that are modern and dynamic. This book will take you through all of the essential concepts in ASP.NET Core 2.0, so you can learn how to build powerful web applications.

The book starts with a brief introduction to the ASP.NET Core framework and the improvements made in the latest release, ASP.NET Core 2.0. You will then build, test, and debug your first web application very quickly. Once you understand the basic structure of ASP.NET Core 2.0 web applications, you'll dive deeper into more complex concepts and scenarios.

Moving on, we'll explain how to take advantage of widely used frameworks such as Model View Controller and Entity Framework Core 2 and you'll learn how to secure your applications. Finally, we'll show you how to deploy and monitor your applications using Azure, AWS, and Docker.

After reading the book, you'll be able to develop efficient and robust web applications in ASP.NET Core 2.0 that have high levels of customer satisfaction and adoption.

Style and approach

Start an exciting journey to building high performance web applications using ASP.NET Core 2.0 and MVC

Table of contents

  1. Preface
    1. Once upon a time, NGWS and the .NET Framework
    2. What this book covers
    3. What you need for this book
    4. Who this book is for
    5. Conventions
    6. Reader feedback
    7. Customer support
      1. Downloading the example code
      2. Errata
      3. Piracy
      4. Questions
  2. What is ASP.NET Core 2.0?
    1. ASP.NET Core 2.0 features
    2. Cross-platform support
    3. Microservice architecture
    4. Working with Docker and containers
    5. Performance and scalability
    6. Side-by-side deployments
    7. Technology restrictions
    8. When to choose ASP.NET Core 2.0
    9. Summary
  3. Setting Up the Environment
    1. Visual Studio 2017 as a development environment
    2. How to install Visual Studio 2017 Community Edition
      1. First steps with Visual Studio 2017
      2. Creating your first ASP.NET Core 2.0 application in Visual Studio 2017
      3. Creating your first ASP.NET Core 2.0 application via the command line
    3. Visual Studio Code as a development environment
    4. How to install Visual Studio Code on Linux
      1. Creating your first ASP.NET Core 2.0 application in Visual Studio Code
      2. Creating your first ASP.NET Core 2.0 application in Linux
    5. Summary
  4. Creating a Continuous Integration Pipeline in VSTS
    1. Continuous integration, continuous deployment, and build and release pipelines
      1. Using VSTS for continuous integration and continuous deployment
      2. Creating a free VSTS subscription and your first VSTS project
    2. Organizing your work via work items
    3. Using Git as a version control system
      1. Using feature branches
      2. Merging changes and resolving conflicts
    4. Creating a VSTS build pipeline
    5. Creating a VSTS release pipeline
    6. Summary
  5. Basic Concepts of ASP.NET Core 2.0 - Part 1
    1. Building the Tic-Tac-Toe game
      1. Conceiving and implementing your first Tic-Tac-Toe feature
    2. Targeting different .NET Framework versions in the .csproj files of your projects
    3. Using the Microsoft.AspNetCore.All metapackage
    4. Working with the Program class
    5. Working with the Startup class
      1. Preparing the basic project structure
      2. Creating the Tic-Tac-Toe home page
    6. Giving your web pages a more modern look by using Bower and layout pages
      1. Creating the Tic-Tac-Toe user registration page
    7. Using dependency injection for encouraging loose coupling within your applications
      1. Creating the Tic-Tac-Toe user service
    8. Working with middlewares
    9. Working with static files
    10. Using routing, URL redirection, and URL rewriting
    11. Adding error handling to your applications
    12. Summary
  6. Basic Concepts of ASP.NET Core 2.0 - Part 2
    1. Client-side development using JavaScript
    2. Optimizing your web applications and using bundling and minification
    3. Working with WebSockets for real-time communication scenarios
    4. Taking advantage of session and user cache management
    5. Applying globalization and localization for multi-lingual user interfaces
    6. Configuring your applications and services
    7. Using logging
    8. Implementing advanced dependency injection concepts
    9. Building once and running on multiple environments
    10. Summary
  7. Creating MVC Applications
    1. Understanding the Model View Controller pattern
      1. Models
      3. Controllers
      4. Unit tests
      5. Integration tests
    2. Creating dedicated layouts for multiple devices
    3. Using View Pages, Partial Views, View Components, and Tag Helpers
      1. Using View Pages
      2. Using Partial Views
      3. Using View Components
      4. Using Tag Helpers
    4. Dividing web applications into multiple Areas
    5. Applying advanced concepts
      1. Using view engines
      2. Providing better quality by creating unit tests and integration tests
        1. Adding unit tests
        2. Adding integration tests
    6. Summary
  8. Creating Web API Applications
    1. Applying Web API concepts and best practices
      1. Building RPC-style Web APIs
      2. Building REST-style Web APIs
      3. Building HATEOAS-style Web APIs
    2. Summary
  9. Accessing Data using Entity Framework Core 2
    1. Getting started with Entity Framework Core 2
      1. Establishing a connection
      2. Defining primary keys and foreign keys via Data Annotations
      3. Using Entity Framework Core 2 Migrations
      4. Creating, reading, updating, and deleting data
    2. Summary
  10. Securing ASP.NET Core 2.0 Applications
    1. Implementing authentication
      1. Adding basic user forms authentication
      2. Adding external provider authentication
      3. Working with two-factor authentication
      4. Adding forgotten password and password reset mechanisms
      5. Implementing authorization
    2. Summary
  11. Hosting and Deploying ASP.NET Core 2.0 Applications
    1. Hosting applications
    2. Deploying applications in Amazon Web Services
      1. Deploying applications in AWS Elastic Beanstalk
    3. Deploying applications in Microsoft Azure
      1. Deploying applications in Microsoft Azure App Services
    4. Deploying applications into Docker containers
      1. Deploying applications into Docker containers using Docker for Windows and Docker Enterprise Edition
      2. Publishing images to the Docker Hub
    5. Summary
  12. Managing and Supervising ASP.NET Core 2.0 Applications
    1. Logging in ASP.NET Core 2.0 applications
      1. Logging in Microsoft Azure
      2. Logging in Amazon Web Services
    2. Monitoring ASP.NET Core 2.0 applications
      1. Monitoring on-premises and in Docker
      2. Monitoring in Microsoft Azure
      3. Monitoring in Amazon Web Services
    3. Summary

Product information

  • Title: Learning ASP.NET Core 2.0
  • Author(s): Jason De Oliveira, Michel Bruchet
  • Release date: December 2017
  • Publisher(s): Packt Publishing
  • ISBN: 9781788476638