ASP.NET Core 2.0 New Features Flashcards

Learn the difference between ASP.NET Core and ASP.NET 4.x

1
Q

What is the difference between ASP.NET Core and ASP.NET 4.x?

A

ASP.NET 4.x is a mature framework providing the services for building enterprise grade, server based (web-) applications.

ASP.NET Core is an open-source, cross-platform framework made for building modern cloud based (web) applications on Windows, Linux or macOS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the differences between Core and 4.x regarding the framework features / library - availability?

A

Core: Build for Windows, macOS and Linux. Building WebUI using Razor Pages as per Microsofts recommended approach from Core 2.0 onwards (using MVC, SignalR and WebAPI). Core can support mutiple versions per machine. Develop using Visual Studio, Visual Studio for Mac or Visual Studio Code, using C# or F#. Greater performance than 4.x. Choose between .NET Framework and .NET Core runtime.

.NET 4.x: Build for Windows. User Microsoft WebForms, SignalR, Webhooks, MVC, webAPI and WebPages. Supports only one version per machine. Develop using C#, F# or Visual Basic. Good performance, Use .NET Framework Runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When would you choose .NET Core over .NET 4x?

A

When you target multiple platforms.
When you are targeting microservices architecture.
When you are using Docker containers.
You need high-performance, scalable systems.
You need side-by-side .Net version per application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When would you choose .NET 4.x over .NET Core?

A

When you have an existing (large) Codebase and porting would take a considerabe amount of time. Extend instead of migrate. Your app uses / relies on 3rd party / nuget packages not available for .NET Core. your app uses technologies not available for .NET Core. .NET Core does not support your target platform.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the main new features implemented in ASP.NET Core 2.0?

A

Razor Pages
ASP.NET Core Metapackage
Runtime Store
.NET Standard 2.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is / are RazorPages?

A

New feature for ASP.NET Core MVC. Makes building page based applications easier. See Razor syntax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Microsoft.AspNetCore.All Package?

A

ASP.NET Core Metapackage => Called: Microsoft.AspNetCore.All, is the Package containing all packages made by the ASP.NET Core and ASP.NET EntityFramework teams as well as their internal 3rd party libraries. You no longer need to select packages manually. This Package is used in all project templates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Runtime Store?

A

Applications that use the ASP.NET Core Metapackage automatically take advantage of the Runetime Store. The runtime store contains all assets required to run ASP.NET Core 2.0 applications. When you use the metapackage, no assets from the ASP.NET Core package need to be deployed because they already reside on the target system.

The assets are also precompiled to improve application startup time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Configuration Update in 2.0?

A

An IConfiguration instance is added to the servicecontainer in .NET Core 2.0 making it easier to retrieve configuration values from the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Logging update in 2.0?

A

In 2.0 logging is implemented into the DI by default. You add providers and configure filters in the program.cs files, instead of the startup.cs file. ILOggerFactory is highly customisable for cross-provider, as well as for specific provider filtering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Authentication and Identity updates?

A

A new authentication model makes it easier to implement authentication with DI. Switch to use Identity 2.0. You can new easily secure your API and retrieve API-access tokes using the Microsoft Authentication Library (MSAL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What about Single Page Application Templates?

A

SPA templates for Angular, Aurelia, Knockout.js, React.js and React.js with Redux.js are now available. Angular template has been updated to use Angular 4.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Kestrel improvements?

A

Kestrel webserver has been imporved to make it more suitable as an inernet facing webserver. A nuber of server constraint configuration opteions can ow be added using the “limit” property of the “KestrelServerOptions” class, such as:

Maximum client connections.
Minimum request body size
Minimum request body data rate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Enhanced HTTP Header Support?

A

When using MVC to transmit a FileStreamResult or a FileContentResult, you now have the option to set an eTag and -/ or a LastModifiedDate on the content you transmit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Hosting environment injecting dependancies / application insights?

A

Hosting environments can now inject dependencies into an application without the application having to explicitly declare those dependencies themself. F.e.: When debugging in visual studio, application insights are used automatically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Changes to Antiforgerytokens?

Bonus: Which type of attack are AFT designed to prevent?

A

Antiforgerytokens are now being used (issued) automatically and ASP.NET Core 2.0 will automatically validate them on a form post without additional configuration.

Bonus: Cross-Site Request Forgery attacks. (XSRF)

17
Q

Automatic precompilation?

A

Razor View precompilation is now enabed by default resulting in a small sized publish result.

18
Q

Razor support for C# 7.1 enabled?

Bonus: Which features exactly are suppoted?

A

Razor views now support C# 71.1 standard features like:

Default Expressions
Inferred Tuple Names
Pattern-Matching with generics.