@manhng

Welcome to my blog!

.NET Core Console Application

October 7, 2021 10:22

.NET Core Console Application Template (edit)

The Top 43 Dotnet Template Open Source Projects on Github

The Top 43 Dotnet Template Open Source Projects on Github (awesomeopensource.com)

Azure Database for PostgreSQL libraries for .NET - Azure for .NET Developers | Microsoft Docs

A starting point for Clean Architecture with ASP.NET Core

ardalis/CleanArchitecture: A starting point for Clean Architecture with ASP.NET Core (github.com)

Clean Architecture Solution Template for Angular 12 and .NET 5

jasontaylordev/CleanArchitecture: Clean Architecture Solution Template for Angular 12 and .NET 5 (github.com)

ASP.NET Core Hero Boilerplate - .NET 5 Clean Architecture

ASP.NET Core Hero Boilerplate - .NET 5 Clean Architecture (codewithmukesh.com)

8) Tổng hợp các kiến thức và các thư viện phổ biến

Tổng hợp các kiến thức và các thư viện phổ biến (dotnetcoban.com)

Các kiến thức chung

Operating Systems
Basic Terminal
Protocols (HTTP, FTP, SSH ...)
HTTP, HTTP/2, HTTPS, DNS, Networking, Hosting
Web Server
Character Encodings
OOP
Data Structures and Algorithms
Software Design (Logical, Process, Development, Physical, Use Case View)
Software Design (Class, Database, Flow, Sequence Diagram)
Design Patterns (Creational, Structural, Behavioral)
Design Patterns (Repository, Unit of Work, Specification, Service Locator, CQRS, Event Sourcing)
Domain Driven Design (Domain Complexity, Technical Complexity, Seperation of Concerns, Sub-domains, Bounded Contexts, Context Maps, Context Boundaries, Ubiquitous Language)
Domain Driven Design (Entities, Value Objects, Domain Services, Aggregates, Repositories, Anti-corruption Layers, Domain Events, Anemic vs Rich Models)
Architecture Patterns (Layered, Modular, Service-Oriented, Microservices, Serverless)
SOLID, KISS, YAGNI, DRY
Git, Github
CI/CD
HTML, CSS, Javascript
SQL Database (SQL, ORM, Indexes, Transactions, Normalization,  Replication, Sharding, CAP)
SQL Server (Views, Functions, Stored Procedures, Triggers, Indexes, ...)
NoSQL Database
Dependency Injection
APIs (REST, gRPC, GraphQL, Open API, Swagger)
Authentication (Cookies, Basic, Windows, Token, JWT, OAuth2, OpenID)
Authorization (Roles, Claims, Attributes, Policies)
Localization, Globalization
Caching
Search
Web Socket
Load Balancing
Web Securies (HTTPS, SSL/TLS, CORS, Hashing)
Testing (Unit, Behavior, Integration, E2E)
Single Page Application (Angular, React, Vue)
Package Managers
Serverless
Microservices
Cloud

Các kiến thức liên quan đến nền tảng  .NET

C# (OOP, Generics, Linq, Collections, Attributes, Reflection, Delegate, Event, Extension Method, Anomymous Methods, Lamda Expression, Expression Tree, Async/Await, Multi-Threading, Regular Expressions, Reflection, Dynamics, Cryptography)
Package Manager (Nuget)
ASP .NET Core (Application Settings, Configurations ...)
ASP .NET Core MVC (Models-Views-Controllers, Request Life Cycle, Middlewares, Routing, Model Binding, Model Validation, Action, Filters, View Engines, View Components, Tag Helpers, Action Results, Global Exception Handler, Attributes, ...)
ASP .NET Core Razor Pages
Blazor ( Server Side, WebAssembly)
Profiler
Dotnet CLI
Blazor

Các kiến thức liên quan đến triển khai trên mô hình Microservices

Container (Docker)
Kubernetes
Messaging Patterns (Fire - Forget, Send - Receive, Request - Response, Publish - Subscribe)
Message Broker
Message Bus
API Gateway
Service Discovery
Service Proxy
Monitoring
Tracing
Service Mesh
Cloud Native

Một số thư viện, công cụ hỗ trợ phân theo các nhóm chủ đề khác nhau

CQRS

MediatR

Mapping

AutoMapper, Mapster

Validation

FluentValidation
Ensure.That
Dawn.Guard
Ardalis.GuardClauses

Datetime

Nodatime

Depencency Injection

Microsoft.Extensions.DependencyInjection + Scrutor
Autofac
Unity
NInject
Castle.Windsor
CommonServiceLocator
Structuremap
SimpleInjector
DryIoc

Database

Relational Database
SQL Server (ADO.NET, System.Data.SqlClient, Microsoft.EntityFrameworkCore.SqlServer)
SQLite, Realm
MySQL, MariaDB, Vitess, TiDB (MySqlConnector, MySql.Data, Pomelo.EntityFrameworkCore.MySql)
PostgreSQL, CockroachDB (Npgsql.EntityFrameworkCore.PostgreSQL, Marten)

NoSQL Databases
MongoDB (MongoDB.Driver, MongoDB.Driver.GridFS)
CouchDB (CouchDB.NET)
Cassandra (CassandraCSharpDriver)
RavenDB (RavenDB.Client)

Key-Value Storage
Redis
LevelDB, RocksDB
TiKV
Cloud Databases
Azure CosmosDB
Amazon DynamoDB

Dapper
EF Core
NHibernate

GraphQL

HotChocolate
GraphQL .NET
Tanka.graphql

GraphQL.Server.Ui.Playground
GraphQL.Server.Ui.Voyager
GraphQL.Server.Ui.GraphiQL

Apollo

APIs

ASP .NET Core

Swashbuckle, NSwag

ServiceStack

File 

CsvHelper, EPPlus, ClosedXML, ExcelDataReader

Itextsharp, PdfSharp, DinkToPdf, IronPdf

SharpZipLib, System.IO.Compression.ZipFile, SharpCompress, DotNetZip
DocX
GemBox.Document

Serializer/Deserializer

Newtonsoft.Json, System.Text.Json, Utf8Json, ServiceStack.Text
MessagePack
protobuf-net

Testing

xUnit, NUnit
Moq, NSubstitute, FakeItEasy, AutoFixture, JustMock
FluentAssertions, Shouldly

OpenCover, AxoCover, dotCover

WebApplicationFactory, TestServer

Selenium, PuppeteerSharp

Genfu
Bogus
Faker-cs
NBuilder

Netling

Security

IdentityServer4
Microsoft.IdentityModel.JsonWebTokens
System.IdentityModel.Tokens.Jwt
Microsoft.IdentityModel.Tokens
Microsoft.AspNetCore.Authentication.JwtBearer
Microsoft.AspNetCore.Authentication.OpenIdConnect
Microsoft.AspNetCore.Authentication.Cookies
Microsoft.AspNetCore.Authentication.OAuth
Microsoft.AspNetCore.Authentication.Google
Microsoft.AspNetCore.Authentication.Facebook
Microsoft.AspNetCore.Authentication.Twitter
Microsoft.AspNetCore.Authentication.MicrosoftAccount
Microsoft.AspNetCore.Authorization
Microsoft.AspNetCore.Identity

FusionAuth
Keycloak

Logging

Serilog, Nlog, log4net
Fluentd, Logtash, Seq, Grafana Loki, Sentry.io, Graylog, Splunk, Loggly

Caching

Memory caching
Distributed caching (Redis, Memcached)
Database Caching

StackExchange.Redis
CacheManager
EasyCaching

Monitoring

App Metrics
Prometheus (Prometheus-net)
Grafana

Tracing

OpenTelemetry, OpenCensus, OpenTracing
Zipkin, Jaeger

Socket

WebSocket (SignalR)
SuperSocket
BedrockFramework

Sync Messaging (REST)

RestSharp
System.Net.Http
Microsoft.AspNet.WebApi.Client
Refit
System.Net.Http.Json
RestEase
ServiceStack.HttpClient
RestClient.Net
Flurl.Http

Polly

Sync Messaging (RPC)

gRPC
Google.Protobuf
Grpc
Grpc.Core
Grpc.Reflection
Google.Api.Gax.Grpc
Grpc.Tools
Grpc.AspNetCore
protobuf-net.Grpc

Async Messaging

Message Broker
RabbitMQ (RabbitMQ.Client, RawRabbit)
Apache Kafka (Confluent.Kafka)
ActiveMQ
Azure Service Bus
Amazon SQS
MQTT (MQTTnet)
CloudEvents + NATS

Message Bus
CAP
EasyNetQ
Rebus
MassTransit
NServiceBus

API Gateway

Ocelot, Kong, Ntrada
Envoy
YARP

Background Tasks

HangFire, Quartz.NET, Coravel, FluentScheduler, Ncrontab
Worker Service

Search

ElasticSearch (Elasticsearch.Net, NEST)
Solr
Sphinx
Lucene.Net

Service Discovery

Consul
Neflix Eureka (Steeltoe.Discovery.ClientCore)

Service Mesh

Linkerd, Istio, Consul Connect, Kuma

Service Proxy, Load Balancer

Envoy
Nginx
HAProxy
Traefik

Kubernetes

Helm
Portainer, Rancher

Storing secrets 

Azure Key Vault
Vault (VaultSharp)

CI/CD

AppVeyor, Travis CI, GitLab CI, Bitbucket Pipelines, Azure Pipeline

Source Control

Git
Github, GitLab, Bitbucket

Web  Server

Nginx, Apache

Email, SMS 

MailKit, SendGrid, FluentEmail
Twilio

Health Checks

AspNetCore.HealthChecks.*

JetBrains Tools

Rider IDE
ReSharper
dotCover
dotPeek
dotTrace
dotMemory

Microservice Framework

Steeltoe
Foundatio
Abp

Graphics, Image Processing

SkiaSharp
EMGU.CV, OpenCVSharp
ImageProcessor
ImageResizer
ZXing.Net
Magick.NET

AWS

AWSSDK.*

Azure

Azure Active Directory
Azure SignalR Service
Azure App Service
Azure Functions
Azure Kubernetes Service


Code Analysis
StyleCop
SonarQube

Utilities

DynamicExpresso
GlobalExceptionHandler
Figgle
SmartFormat.NET
ReflectionMagic
Dbup, FluentMigrator, Redgate Flyway
System.ValueTuple
MessagePack
System.Reactive
Humanizer.Core
Nancy
Pipelines.Sockets.Unofficial
DnsClient
JetBrains.Annotations
SmartSql
LetsEncrypt
BenchmarkDotNet
ProxyKit
NewId
Morelinq, LinqKit
MetadataExtractor
Wangkanai.Detection
WebEssentials.AspNetCore.ServiceWorker
NetEscapades.AspNetCore.SecurityHeaders
Joonasw.AspNetCore.SecurityHeaders
NWebsec
WebMarkupMin
MiniProfiler
IPNetwork2
Exceptionless
AspNetCoreRateLimit
FluentFTP
WinSCP
Njsonschema
Xabe.FFmpeg
SSH.NET
StyleCop.Analyzers
FastMember
AngleSharp
NUglify
TimeZoneConverter
BCrypt.Net
QRCoder
NBitcoin
YamlDotNet
ReportGenerator
CommandLineParser
Antlr
WebGrease
MedallionShell
GMap.NET
Topshelf, Microsoft.Extensions.Hosting.WindowsServices

7) EF Core + PostgreSQL

PostgreSQL EF Core Code-First Conventions

PostgreSQL data types cheatsheet | TablePlus

Postgres Data Types: Cheat Sheet | Simplecode

Code-First Conventions in Entity Framework 6 (entityframeworktutorial.net)

Npgsql Entity Framework Core Provider | Npgsql Documentation

Get to Know Entity Framework and PostgreSQL | Okta Developer

How to Configure PostgreSQL in Entity Framework Core - Code Maze (code-maze.com)

ASP.NET Core, Entity Framework Core with PostgreSQL Code First | by Hidayat Arghandabi | FAUN Publication

Getting Started with Entity Framework Core (PostgreSQL) | by Robert Chanphakeo | Medium

Customising ASP.NET Core Identity EF Core naming conventions for PostgreSQL

Customising ASP.NET Core Identity EF Core naming conventions for PostgreSQL (andrewlock.net)

Table and Column Naming

Table and Column Naming | Npgsql Documentation

Fluent API

Entity Framework Core Fluent API - TekTutorialsHub

Script-Migration

Entity Framework Core Code First - Basic and Custom Migrations for PostgreSQL (craftedpod.com)

Add-Migration

Script-Migration

Update-Database

Database-First

Install-Package Microsoft.EntityFrameworkCore.Design

Install-Package Microsoft.EntityFrameworkCore.Tools

Install-Package Npgsql.EntityFrameworkCore.PostgreSQL

dotnet tool install --global dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.EntityFrameworkCore.Tools
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
dotnet restore
dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL
dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL -c ContextName -o OutPutFolder

GUID (UUID)

How to generate PostgreSQL UUID with EF Core | Gary Woodfine

EF Core & PostgreSQL - Kiến trúc Microservices (microservicesvn.com)

EF Core Configuration - Kiến trúc Microservices (microservicesvn.com)

6) CQRS pattern + Mediator pattern + MediatR Pipeline Behaviors

How to implement cross cutting concerns with MediatR Pipeline Behaviours | Gary Woodfine

5) NET Core Console App

Create a dotnet core Cosnole app template with autofac dependency injections | by Kevin W | Medium

superwalnut/dotnet-console-app-template: This is a project template for .Net Core 3.1 console app, pre configured Autofac, Serilog, AutoMapper, Newtonsoft.Json (github.com)

gtechsltn/dotnet-console-app-template: This is a project template for .Net Core 3.1 console app, pre configured Autofac, Serilog, AutoMapper, Newtonsoft.Json (github.com)

  • Autofac
  • Serilog
  • AutoMapper

Automatically build and deploy .NET core 3 console application as a Windows service

Automatically build and deploy .NET core 3 console application as a Windows service | by Tai Bo | Medium

4) Cronos

gtechsltn/sample-netcore3-console-as-windows-service (github.com)

Fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions

HangfireIO/Cronos: Fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions (github.com)

3) Schedule Cron Jobs using HostedService in ASP.NET Core

gtechsltn/ServiceWorkerCronJob: Schedule Cron Jobs using HostedService in ASP.NET Core (github.com)

2) NET Core + Angular 9

Designing a DDD-oriented microservice | Microsoft Docs

Diagram showing the layers in a domain-driven design microservice.

 

Diagram showing dependencies that exist between DDD service layers.

gtechsltn/BookStore: Project using .NET Core 3.1, Angular 9, EF Core, SQL Server, xUnit with SQLite database InMemory and EF Core InMemory (github.com)

Web API Project using .NET Core 3.1 and SPA project using Angular 9

Technologies

  • .NET Core 3.1
  • Entity Framework 3.1
  • Fluent API
  • AutoMapper
  • Swagger
  • SQL Server

Unit tests

  • xUnit
  • Moq
  • SQLite In-Memory database

SPA

  • Angular 9
  • Ng-Bootstrap
  • Ngx-Toastr

Architecture

  • 3 Layers:
    • Application layer (API)
      • Controllers
      • Dtos
    • Domain layer
      • Models
      • Interfaces
      • Services
    • Infrastructure layer
      • Repository Pattern
  • SPA

Articles

On the series of articles, "Creating an Application from Scratch using .NET Core and Angular", there is the explanation step by step about how this code was implemented:

A starting template for ASP.NET Core 3.1 Console application that supports dependency injection, asynchronous programming, logging using Serilog, strongly-typed configuration, etc..

gtechsltn/aspnetcore-console-app-template: A starting template for ASP.NET Core 3.1 Console application that supports dependency injection, asynchronous programming, logging using Serilog, strongly-typed configuration, etc.. (github.com)

1) Project Template - .Net Core 3.1 Console app + Autofac + Serilog + AutoMapper

dotnet new --install Superwalnut.NetCoreConsoleTemplate

gtechsltn/dotnet-console-app-template: This is a project template for .Net Core 3.1 console app, pre configured Autofac, Serilog, AutoMapper, Newtonsoft.Json (github.com)

Categories

Recent posts