万本电子书0元读

万本电子书0元读

顶部广告

Learning ASP.NET Core MVC Programming电子书

售       价:¥

16人正在读 | 0人评论 6.2

作       者:Mugilan T. S. Ragupathi

出  版  社:Packt Publishing

出版时间:2016-11-01

字       数:96.6万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Learn the fundamentals of ASP.NET MVC and build real-world web applications using ASP.NET Core MVC About This Book Get a first-principles coverage of ASP.NET MVC and the latest release, Core This book is uniquely designed for developers who are looking to transition their skills into the .NET development field The standalone chapter structure leaves you free to explore ASP.NET MVC to immediately solve your pain points Who This Book Is For This book is for developers who want to learn to build web applications using ASP.NET Core, developers who want to make a career building web applications using Microsoft technology, and developers who are working in Ruby on Rails or other web frameworks and want to learn ASP.NET Core MVC. No knowledge of the ASP.NET platform or the .NET platform is required. Even though you do not need to have experience in C#, an understanding of the basic constructs (loops, conditionals, classes, and objects) of any modern programming language would be helpful. What You Will Learn Get to know the concepts of ASP.NET MVC and build a new static web page using HTML, CSS, and jQuery Set up a development environment and run a sample application using the template Create a Controller with action methods Build a view using several features of the Razor View engine Construct a Model for ASP.NET Core MVC application Devise a custom mechanism to provide maximum flexibility to your application through routing Validate the user input on the client side using jQuery Enhance your applications using Bootstrap Explore new configuration and deployment scenarios—step by step guide to deploying ASP.NET Core web application in Linux In Detail ASP.NET Core MVC helps you build robust web applications using the Model-View-Controller design. This guide will help you in building applications which can be deployed on non-windows platforms such as Linux. In today’s age, it is crucial that you possess the ability to separate the programming and business logic, and this is exactly what ASP.NET Core MVC application will help you achieve. This version comes with a number of improvements that enable fast, TDD-friendly development to create sophisticated applications. You would also learn the fundamentals of Entity framework and on how to use the same in ASP.NET Core web applications. The book presents the fundamentals and philosophies of ASP.NET Core. Starting with an overview of the MVC pattern, we quickly dive into the aspects that you need to know to get started with ASP.NET. You will learn about the core architecture of model, view, and control. Integrating your application with Bootstrap, validating user input, interacting with databases, and deploying your application are some of the things that you will be able to execute with this fast-paced guide. The end of the book will test your knowledge as you build a fully working sample application using the skills you’ve learned throughout the book. Style and approach This book takes a first-principles approach to help you understand and implement ASP.NET MVC solutions. It is focused primarily on giving you practical skills rather than the old conventional theoretical teaching.
目录展开

Learning ASP.NET Core MVC Programming

Learning ASP.NET Core MVC Programming

Credits

About the Author

About the Reviewers

www.PacktPub.com

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. Introduction to ASP.NET Core

How web applications work

So what is an HTTP protocol?

Request-response pattern

Stateless nature of HTTP

Client-side and server-side

HTTP methods

GET method

POST method

What is ASP.NET?

ASP.NET Web Forms

ASP.NET Web Pages

ASP.NET MVC

Features of ASP.NET MVC

Convention over configuration

Separation of concerns

Control over the generated HTML

Better support for unit testing

ASP.NET 5

Features of ASP.NET 5

Summary

2. Setting Up the Environment

Purpose of IDE

Visual Studio offerings

System requirements

Visual Studio Community 2015

Visual Studio Professional

Visual Studio Enterprise

Visual Studio Test Professional

Installing Visual Studio Community

Installing ASP.NET 5

Project structure in ASP.NET 5 application

File-based project

Support for full .NET and .NET core

The Project.json package

Controllers

Models

Views

Migrations

The wwwroot folder

Other files

Summary

3. Controllers

Role of the Controller in ASP.NET MVC applications

Introduction to routing

Creating ASP.NET 5 application

Installing the ASP.NET Core NuGet package in your application

Our first Controller

IActionResult

Adding Views

Adding Models

Passing data from Controller to View

Filters

Authorization filters

Resource filters

Action filters

Exception filters

Result filters

Summary

4. Views

The View engine and the Razor View engine

Razor View engine

Programming in Razor View engine

Variables in Razor View

The for loop

The while loop

The foreach loop

The if condition

Layout

Creating _ViewStart.cshtml

Creating _Layout.cshtml

Adding a page-specific View

Generating HTML

HTML Helpers

Partial View

Calling the Partial View

View components

Creating a View component

Tag Helpers

Creating custom Tag Helpers

Summary

5. Models

Models

Models specific to a View component

Note on ViewModels

Data flow with respect to a Model

Model binding

The Entity Framework

The Entity Framework is independent of ASP.NET MVC

Creating console applications with the Entity Framework

Installing the Entity Framework 7 NuGet package

Using the NuGet Package Manager

Using the Package Manager Console

Installing Entity Framework commands

Creating Model classes

Creating the DbContext class

Create a migration

How the SaveChanges method works

Updating the record

Deleting the record

Using the Entity Framework in ASP.NET MVC applications

Database migration

Summary

6. Validation

Client-side and server-side validation

Server-side validation

Updating View models with the Data Annotation attribute

Updating the View model to display the validation error message

Updating the controller action method to verify the model state

Client-side validation

Implementation

Summary

7. Routing

Convention-based routing

Example 1

Example 2

Example 3

Example 4

Attribute-based routing

Route attribute at the controller level

Passing routing values in HTTP action verbs in the Controller

Route Constraints

Summary

8. Beautifying ASP.NET MVC Applications with Bootstrap

Knowing HTML and CSS

Bootstrap

Bootstrap Grid system

Forms

Inline forms

Horizontal forms

Table CSS classes

Striped tables

Hover tables

Bordered tables

Contextual classes in table

Buttons

Button sizes

Contextual colors

Using Bootstrap in your ASP.NET MVC application

Installing with Bower

HTML doctype

Summary

9. Deployment of ASP.NET Core Application

The project.json file

The dependencies node

The frameworks node

Microsoft Azure

Signing up to Microsoft Azure

Prerequisites to Azure deployment

Deploying the ASP.NET Core application in Azure

Deploying the ASP.NET Core web application in the Linux environment

Creating a Linux machine

Installing the PuTTY client

Installing of .NET Core in a Linux machine

Creating a new ASP.NET 5 project

Configuring the Nginx server

Summary

10. Building HTTP-based Web Services Using ASP.NET Web API

HTTP basics

HTTP verbs

GET method

PUT method

POST method

DELETE method

Fiddler tool

Dependency Injection

Delete method

The Web API method for deleting a resource

Web Repository layer code for deleting the employee data

Summary

11. Improving Performance of an ASP.NET Core Application

The UI layer

Reducing the number of HTTP requests

Using GZip compression

Using the Content Delivery Network (CDN)

Using JavaScript wherever possible

Using CSS stylesheets

Minification of JavaScript and CSS files and their combination

The caching process

Client-side caching

Response caching

The web/application layer

No business logic in Views

Using asynchronous logging

The DB layer

Understanding the queries generated by the ORM

Using classic ADO.NET if you really want to

Return only the required data

Fine tuning the indices

Using the correct column type and size for your database columns

Avoiding correlated subqueries

Generic performance improvement tips

Avoiding the Response.Redirect method

Using string builder

Summary

12. ASP.NET Core Identity

Authentication

Authorization

Adding the relevant dependencies to the project.json file

Adding ApplicationUser and ApplicationDbContext classes

Configuring the application to use Identity

Creating ViewModels

Creating Controllers and associated action methods

Creating Views

E-mail and SMS services

Securing an action method in a Controller

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部