ASP.NET Core Interview Questions πΌ
This post is about ASP.NET Core Interview Questions. βοΈ
These questions are directly tied to ASP.NET Core. β
They are not meant to serve as only questions that you would ask a candidate during an interview. β
Use these to assess if the candidate has any knowledge about ASP.NET Core. π
The questions should serve as guidelines for core ASP.NET Core concepts that candidate should be familiar with. πͺ
https://t.me/pgimg/100
[ Article ] : http://bit.do/aspint
γ°γ°γ°γ°γ°γ°
#AspMvc #AspCore #Core #Interview
@ProgrammingTip
This post is about ASP.NET Core Interview Questions. βοΈ
These questions are directly tied to ASP.NET Core. β
They are not meant to serve as only questions that you would ask a candidate during an interview. β
Use these to assess if the candidate has any knowledge about ASP.NET Core. π
The questions should serve as guidelines for core ASP.NET Core concepts that candidate should be familiar with. πͺ
https://t.me/pgimg/100
[ Article ] : http://bit.do/aspint
γ°γ°γ°γ°γ°γ°
#AspMvc #AspCore #Core #Interview
@ProgrammingTip
Telegram
Programming Tips Resources
Securing ASP.NET Core 2.0 Applications with JWTs + Auth0 π
JSON Web Tokens, often shortened with JWTs, are gathering more and more popularity in the Web environment. π
It is an open standard that allows transmitting data between parties as a JSON object in a compact and secure way. π
They are usually used in authentication and information exchange scenarios, since the data transmitted between a source and a target are digitally signed so that they can be easily verified and trusted. β
Let's take a look at how to set up a ASP.NET Core 2 application with JWT support by creating a Web API application. β¨
https://t.me/pgimg/110
[ Article ] : http://bit.do/auth0
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #JWT
@ProgrammingTip
JSON Web Tokens, often shortened with JWTs, are gathering more and more popularity in the Web environment. π
It is an open standard that allows transmitting data between parties as a JSON object in a compact and secure way. π
They are usually used in authentication and information exchange scenarios, since the data transmitted between a source and a target are digitally signed so that they can be easily verified and trusted. β
Let's take a look at how to set up a ASP.NET Core 2 application with JWT support by creating a Web API application. β¨
https://t.me/pgimg/110
[ Article ] : http://bit.do/auth0
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #JWT
@ProgrammingTip
Telegram
Programming Tips Resources
ASP.NET Core 2 β Global Model Validation β οΈ
We use a lot of repetitive code in our actions. β»οΈ
Inside of our controller actions we usually check if the model is valid by using ModelState property available on MVCβs base controller class :
The bad thing about is that we repeat this piece of code throughout a lot of our actions. β
How we can make it betterβ
This article shows you how to validate ModelState with a global filter. π
https://t.me/pgimg/112
[ Article ] : bit.do/mval
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #Validation
@ProgrammingTip
We use a lot of repetitive code in our actions. β»οΈ
Inside of our controller actions we usually check if the model is valid by using ModelState property available on MVCβs base controller class :
if (!ModelState.IsValid)
return BadRequest(ModelState);
The bad thing about is that we repeat this piece of code throughout a lot of our actions. β
How we can make it betterβ
This article shows you how to validate ModelState with a global filter. π
https://t.me/pgimg/112
[ Article ] : bit.do/mval
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #Validation
@ProgrammingTip
Telegram
Programming Tips Resources
Use DbContextPooling to Improve the Performance : .NET Core 2.1 Feature π
If you are familiar with .NET Core, then you might be knowing AddDbContext method. π§
This method is used to inject dependency of DbContext into your controller and it should be written in the Startup.cs class. π
So in case of AddDbContext, a new instance will be created for each request and would get disposed once the work is done. β»οΈ
New contexts are getting created for each request. β³
That is still fine but if there are more than 1k requests β 1k times object will be created and disposed, unless you have made it a Singleton. βπ»
Creating and disposing of so many objects may impact the performance. β
How DbContextPooling can helpβ
https://t.me/pgimg/117
[ Article ] : http://bit.do/dbpol
γ°γ°γ°γ°γ°γ°
#AspMvc #Core
@ProgrammingTip
If you are familiar with .NET Core, then you might be knowing AddDbContext method. π§
This method is used to inject dependency of DbContext into your controller and it should be written in the Startup.cs class. π
So in case of AddDbContext, a new instance will be created for each request and would get disposed once the work is done. β»οΈ
New contexts are getting created for each request. β³
That is still fine but if there are more than 1k requests β 1k times object will be created and disposed, unless you have made it a Singleton. βπ»
Creating and disposing of so many objects may impact the performance. β
How DbContextPooling can helpβ
https://t.me/pgimg/117
[ Article ] : http://bit.do/dbpol
γ°γ°γ°γ°γ°γ°
#AspMvc #Core
@ProgrammingTip
Telegram
Programming Tips Resources
Using MariaDB with ASP.NET Core 2.0 π
What is MariaDBβ
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. π§
Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. π
Basically it is a fork of MySQL which is guaranteed to stay open source, and as noted it is supposed to be a drop-in replacement for MySQL. β¨
So letβs put this to the test with a simple ASP.NET Core application. π₯
https://t.me/pgimg/118
[ Article ] : bit.do/mariad
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
What is MariaDBβ
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. π§
Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. π
Basically it is a fork of MySQL which is guaranteed to stay open source, and as noted it is supposed to be a drop-in replacement for MySQL. β¨
So letβs put this to the test with a simple ASP.NET Core application. π₯
https://t.me/pgimg/118
[ Article ] : bit.do/mariad
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
Telegram
Programming Tips Resources
Blazor π₯
An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly that is supported by Microsoft. π
Blazor is a .NET web framework that runs in any browser. π
Blazor uses only the latest web standards. No plugins or transpilation needed. β
It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. β‘οΈ
It works in older browsers too by falling back to an asm.js based .NET runtime. π΄πΏ
Blazor will have all the features of a modern web framework, including β¨ :
β’ Components
β’ Routing
β’ Layouts
β’ Forms and validation
β’ Dependency injection
β’ JavaScript interop
β’ Live reloading
β’ Server-side rendering
β’ Full .NET debugging
https://t.me/pgimg/120
[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud
γ°γ°γ°γ°γ°γ°
#Blazor #AspMvc #Core
@ProgammingTip
An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly that is supported by Microsoft. π
Blazor is a .NET web framework that runs in any browser. π
Blazor uses only the latest web standards. No plugins or transpilation needed. β
It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. β‘οΈ
It works in older browsers too by falling back to an asm.js based .NET runtime. π΄πΏ
Blazor will have all the features of a modern web framework, including β¨ :
β’ Components
β’ Routing
β’ Layouts
β’ Forms and validation
β’ Dependency injection
β’ JavaScript interop
β’ Live reloading
β’ Server-side rendering
β’ Full .NET debugging
https://t.me/pgimg/120
[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud
γ°γ°γ°γ°γ°γ°
#Blazor #AspMvc #Core
@ProgammingTip
Telegram
Programming Tips Resources
Programming Tips π‘
Photo
ASP.NET Core.2 & Angular 5.pdf
7.3 MB
API Feature Folders β‘οΈ
In ASP.NET Core (and unlike ASP.NET 5 / Web API 2), Web API controllers are just controllers. π
You donβt need to inherit from a different base type or anything like that. β
Whatβs more, your API controllers should be returning DTOs that are separate from your underlying domain or data model. βοΈ
What Iβve found to be a better organization is to do away with the Controllers folder (or keep it around if youβre using view-based controllers) and instead use feature folders for your APIs. π
Iβm partial to having a root level API folder but if youβd prefer to put your features in the root of the project that would work, too. ππ»
Within each feature folder, you include the controller along with any model types it needs to work with, like this πΎ :
https://t.me/pgimg/124
Obviously one benefit of this approach is that itβs more cohesive. β
Things that change together are located physically next to one another, and the friction involved in moving between different folders with too many files in them is greatly reduced. βοΈ
Another nice thing about this approach is that it just works. Unlike view-based controllers, you donβt need to change anything about how ASP.NET Core is configured to have this organization structure work for you. β¨
[ Article ] : bit.do/apif
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #API
@ProgrammingTip
In ASP.NET Core (and unlike ASP.NET 5 / Web API 2), Web API controllers are just controllers. π
You donβt need to inherit from a different base type or anything like that. β
Whatβs more, your API controllers should be returning DTOs that are separate from your underlying domain or data model. βοΈ
What Iβve found to be a better organization is to do away with the Controllers folder (or keep it around if youβre using view-based controllers) and instead use feature folders for your APIs. π
Iβm partial to having a root level API folder but if youβd prefer to put your features in the root of the project that would work, too. ππ»
Within each feature folder, you include the controller along with any model types it needs to work with, like this πΎ :
https://t.me/pgimg/124
Obviously one benefit of this approach is that itβs more cohesive. β
Things that change together are located physically next to one another, and the friction involved in moving between different folders with too many files in them is greatly reduced. βοΈ
Another nice thing about this approach is that it just works. Unlike view-based controllers, you donβt need to change anything about how ASP.NET Core is configured to have this organization structure work for you. β¨
[ Article ] : bit.do/apif
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #API
@ProgrammingTip
Telegram
Programming Tips Resources
Apress - Real-Time Web Application Development.pdf
21.3 MB
Using Redis Cache in .NET Core π
Redis is a high performance distributed cache. Itβs great for storing data that you are going to need again and again in a short period of time when you donβt want to use processing power to βcreateβ that data again. β»οΈ
Think number crunching or heavy SQL queries for data that doesnβt change often. π«
Roll Your Own π€
First off. You can absolutely roll your own Redis Cache services abstracted by your own interfaces etc. β
You may find it a little difficult to find libraries that target .NET Core, but this will change over time. β³
In saying that, there is a β.NET Coreβ way of doing things that is a little different. It does tie you into the framework a little, but it abstracts away the caching completely and letβs Microsoft handle it and thatβs what we are going to go over today. π
https://t.me/pgimg/131
[ Article ] : bit.do/rcache
γ°γ°γ°γ°γ°γ°
#Redis #AspMvc #Core #Cache
@ProgrammingTip
Redis is a high performance distributed cache. Itβs great for storing data that you are going to need again and again in a short period of time when you donβt want to use processing power to βcreateβ that data again. β»οΈ
Think number crunching or heavy SQL queries for data that doesnβt change often. π«
Roll Your Own π€
First off. You can absolutely roll your own Redis Cache services abstracted by your own interfaces etc. β
You may find it a little difficult to find libraries that target .NET Core, but this will change over time. β³
In saying that, there is a β.NET Coreβ way of doing things that is a little different. It does tie you into the framework a little, but it abstracts away the caching completely and letβs Microsoft handle it and thatβs what we are going to go over today. π
https://t.me/pgimg/131
[ Article ] : bit.do/rcache
γ°γ°γ°γ°γ°γ°
#Redis #AspMvc #Core #Cache
@ProgrammingTip
Telegram
Programming Tips Resources