@manhng

Welcome to my blog!

NET 5 + Kendo React

February 26, 2021 14:26

Kendo React (edit)

https://github.com/brillout/awesome-react-components

https://github.com/telerik/kendo-react-stackblitz-app

E-Books

https://github.com/trumpowen/All-Programming-E-Books-PDF/blob/master/allbooks.txt

.NET 5

https://www.microsoft.com/en-us/download/details.aspx?id=101064

https://marketplace.visualstudio.com/items?itemName=anasoft-code.RestApiN

Core features version RestApiN.vsix extension

  • Three layers projects Api, Domain and Entity
  • Automapper
  • Dependency Injection
  • UnitOfWork
  • Generic Service
  • Generic Repository with Entity Framework
  • EF lazy loading and DB concurrency errors
  • Sync and Async calls
  • Generic exception handler
  • Serilog logging with Console and File sinks
  • Migrations and seed from json objects build your empty database
  • JWT authorization/authentication for generated API
  • T4 templates - simple code generation for domain and service classes

Extended features version RestApiNEx.vsix extension

  • All core features included.
  • Swagger and Swashbuckle API documentation for .NET and Swagger authentication
  • Select between Identity Server 4 or JWT authorization/authentication for generated API
  • T4 templates - smart code generation driven by existing entity classes (inherits from BaseEntity). T4 templates generate code for related domain, service, controller and test classes based on added entity classes in single click. Great time saver!
  • XUnit integration tests project added to the solution for IS4 mode or JWT authentication mode.
  • Postman API tests as json file for import (IS4 and JWT tests). Import json and run the tests.
  • Run Postman tests with PowerShell script with Newman command line implementation
  • DDoS API attacks protection service
  • Stored procedure example added to repository

Awesome Blazor

https://github.com/AdrienTorris/awesome-blazor

Awesome JavaScript

https://github.com/gauravmehla/awesome-javascript

https://github.com/gauravmehla/awesome-javascript-1

ASP.NET Core 3.0 + EF Core 3.0 + Web API + Swagger + JWT

October 7, 2019 21:29

ASP.NET Core 3.0 + EF Core 3.0 + Web API + Swagger + JWT

Dependencies

EF Core 3.0

 

 

Swaager

Authorization: Bearer eyJhb...Do

cUrl (link download)

curl -X POST "https://localhost:5001/api/v1/identity/register" -H "accept: */*" -H "Content-Type: application/json" -d "{\"email\":\"test@abc.com\",\"password\":\"Abc@123!\"}" -k

curl -X POST "https://localhost:5001/api/v1/identity/login" -H "accept: */*" -H "Content-Type: application/json" -d "{\"email\":\"test@abc.com\",\"password\":\"Abc@123!\"}" -k

curl -X POST "https://localhost:5001/api/v1/posts" -H "accept: */*" -H "Authorization: Bearer eyJhb...Do" -H "Content-Type: application/json" -d "{\"name\":\"ASP.NET Core + EF Core + WebAPI\",\"tags\":[\"ASP.NET Core\"]}" -k

Source code (link download)

IIS + System.DirectoryServices + Use C# to manage IIS + IIS Manager

October 10, 2018 22:23

Use C# To Manage IIS - Using System.DirectoryServices namespace (edit)

https://stackoverflow.com/questions/24124644/to-get-the-hosted-web-sites-names-from-iis

Use C# to manage IIS

https://www.codeproject.com/Articles/99634/Use-C-to-manage-IIS

Programmatically Manage IIS

https://www.codeproject.com/Articles/31293/Programmatically-Manage-IIS

Windows XP IIS Manager v1.7

https://www.codeproject.com/Articles/9860/Windows-XP-IIS-Manager-v

Need to install the "IIS Metabase and IIS 6 configuration compatibility 

Read more: https://drive.google.com/file/d/19G0_FwXX-odXPnXTk6jVBWCipBODFZdV/

https://docs.oracle.com/cd/E98457_01/opera_5_6_core_help/installing_oeds_on_windows_7_workstation_web_server_IIS_asp_dot_net.htm

https://social.technet.microsoft.com/Forums/windows/en-US/11501684-3e3a-476c-afcd-3b449a4da3c9/iis-6-metabase-and-iis-6-configuration-compatibility-install?forum=w7itproinstall

https://www.activexperts.com/support/network-monitor/online/iis6metabase/

Creating Web API in ASP.NET Core 2.0

https://www.codeproject.com/Articles/1264219/Creating-Web-API-in-ASP-NET-Core-2-0

ASP.NET MVC + Web API

May 21, 2018 17:54

ASP.NET MVC (edit)

https://github.com/chsakell/mvcarchitecture

ASP.NET Web API

https://github.com/chsakell/webapiunittesting

SPA + Web API

https://github.com/chsakell/spa-webapi-angularjs

NUnit Test Adapter

May 19, 2018 09:35

NUnit Test Adapter (edit)

https://stackoverflow.com/questions/43007761/how-to-run-nunit-tests-in-visual-studio-2017

http://www.alteridem.net/2017/05/04/test-net-core-nunit-vs2017/

Cài đặt vào VS

https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter

Cài đặt thông qua Nuget

https://www.nuget.org/packages/NUnit3TestAdapter/

ASP.NET Web API

https://www.c-sharpcorner.com/UploadFile/1492b1/restful-day-sharp6-request-logging-and-exception-handingloggin/

https://www.codeproject.com/Articles/1028416/RESTful-Day-sharp-Request-logging-and-Exception-ha

https://www.infoworld.com/article/3211590/application-development/how-to-log-request-and-response-metadata-in-aspnet-web-api.html

Web API AND XML

March 15, 2018 21:27

Code

Ví dụ

http://www.lateral8.com/articles/2010/3/5/openxml-sdk-20-export-a-datatable-to-excel.aspx

<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccountProblem</Code>
<Message>Your Google account is not currently enabled for this operation. Please check https://console.developers.google.com/billing to see if you have a past due balance or if the credit card (or other payment mechanism) on your account is expired. You can find additional information at https://developers.google.com/storage/docs/signup</Message>
<Details>The billing account for the requested project is disabled in state 'closed'</Details>
</Error>

Dapper Log4net AutoMapper

March 13, 2018 08:35

How to use the Dapper (edit)

- Create new ASP.NET Web Application called WebApplication1 (MVC: Web Forms, MVC, Web API) based on .NET Framework 4.5.2

- Nuget packages:

  + Install-Package log4net

  + Install-Package Dapper

  + Install-Package MySql.Data

  + Install-Package AutoMapper

  + Install-Package Newtonsoft.Json

- Web.config/App.config

  + Define connection string in <connectionStrings> or <appSettings>

- Controllers/HomeController.cs

- Documentation

Dapper with MS SQL Server

- Dapper with raw SQL

 

- Dapper with Stored Procedure

- Sample code

Dapper with MySQL

Nuget notes

+ .NET Framework 4.5
+ ASP.NET MVC 5.2
+ ASP.NET Web API 2.2
+ Web Pages 3.2

Update-Package
Install-Package jQuery -Version 1.12.4
Install-Package Bootstrap -version 3.3.7
Install-Package modernizr
Install-Package Newtonsoft.json
Install-Package log4net
Install-Package Dapper -Version 1.50.2 (.NET Framework 4.5)
Install-Package Microsoft.AspNet.WebApi (-Version 5.2.4)
Install-Package Swashbuckle (-Version 5.6.0)

Web API & Swagger + OAuth2
http://wmpratt.com/swagger-and-asp-net-web-api-part-1/

http://wmpratt.com/part-ii-swagger-and-asp-net-web-api-enabling-oauth2/

https://www.codeproject.com/Articles/1187872/Token-Based-Authentication-for-Web-API-where-Legac

http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ 

Web API

March 2, 2018 23:19

Cách để sử dụng SqlConnection trong WebAPI, sử dụng Web Surge để test web api - Feb 22, 2018

https://www.carlrippon.com/scalable-and-performant-asp-net-core-web-apis-database-connections/

https://websurge.west-wind.com/

Web Surge - Aug 19, 2017

  • Capture HTTP Requests
  • Test HTTP Requests
  • Play them back under Load
  • Summarize Results

Cách để xử lý validate với parameters (model binding) - Feb 27, 2018

https://odetocode.com/blogs/scott/archive/2018/02/27/model-binding-in-get-requests.aspx

JWT in ASP.NET Core Web API - Mar 1, 2018

https://jonhilton.net/identify-users-permissions-with-jwts-and-asp-net-core-webapi/

All posts in the Secure your ASP.NET Core Web API series.

UX 8 design questions to ask

https://blog.walkme.com/ux-8-questions-to-ask/

Categories

Recent posts