Programming Tips πŸ’‘
51.7K subscribers
67 photos
10 videos
30 files
355 links
Programming & AI:
Tips πŸ’‘
Articles πŸ“•
Resources πŸ‘Ύ
Design Patterns πŸ’Ž
Software Principles βœ…

πŸ‡³πŸ‡± Contact: @MoienTajik

🎯 Buy ads: https://telega.io/c/ProgrammingTip
Download Telegram
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.iss.one/pgimg/110

[ Article ] : https://bit.do/auth0

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Core #JWT
@ProgrammingTip
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 :

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.iss.one/pgimg/112

[ Article ] : bit.do/mval

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Core #Validation
@ProgrammingTip
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.iss.one/pgimg/117

[ Article ] : https://bit.do/dbpol

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Core
@ProgrammingTip
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.iss.one/pgimg/118

[ Article ] : bit.do/mariad

γ€°γ€°γ€°γ€°γ€°γ€°
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
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.iss.one/pgimg/120

[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud

γ€°γ€°γ€°γ€°γ€°γ€°
#Blazor #AspMvc #Core
@ProgammingTip
Programming Tips πŸ’‘
Photo
ASP.NET Core.2 & Angular 5.pdf
7.3 MB
ASP.NET Core 2 & Angular 5 - Full Stack Web Development with .NET Core & Angular πŸ“•

Author : Valerio De Sanctis πŸ–Š

Publisher : Packt πŸ’Ž

γ€°γ€°γ€°γ€°γ€°γ€°
#Book #AspMvc #Core #Angular
@ProgrammingTip