ASP.NET Core 应用本质上就是长时间运行的服务，该服务接受一个 HTTP 请求，然后按照预先设计好的路由规则，返回对应的响应（response）。一个 ASP.NET Core 应用程序包含两个主要的组件。
在这篇文章中，将会通过阅读 ASP.NET Core 源码的方式，来探索 ASP.NET Core 如何将服务注册到 Host 中的。
Microsoft.Extensions.Hosting 规范了 .NET 平台下所有长时间运行的服务实现方法，具体的流程是这样的：
Polly 就是这样一个 .Net 库， 它提供了若干种策略（Policy）来让我们的服务在应对各种情况下该如何处理。在 Java 世界里也有相同的库：Hystrix.
Refuse to connect to 'https://localhost:9780/dauthsvc/sign' because it violates the following Content Security Policy directive: "connect-src 'self' api.localhost ....
我们都知道我们的网站会被会被一些不法分子攻击，比如跨站脚本（Cros是Site Script, XSS)，比如说攻击者将一个 …
Implement Git series
Ugit supports a lot of basic git operations. All of them are wrapped into the Operations namespace to make it manageable.
This operation supports the
init command parameter, which has two steps.
This operation is designed to manipulate the branch. For examples
There is no secret in
BranchOperation just read and write
ref/heads folder. Each file of them represents the branch.
Implement Git series
As a CLI program,
ugit must have to accept multi-commands according to the various input. For example
> ugit init
> ugit add a.txt
C# doesn’t support command parameters parse very well. CommandLine does the job very well.
Now, we add
commit command which accepts a required
message parameter. what’s more, you can customize the parameter such short verb and long verb forms.
How to use these option?
By default, this package supports up to 16 options. But in ugit, it probably exceeds that. What we need to do is just adding
Parser extension method.
ugit basic workflow is obvious.
Implement Git series
In the previous post, we have known that Git chooses local file system as database to implement distribution. The key is the the
.ugit folder in the repo. On top of that we build all the command to manipulate the repo for version control.
The architecture of
IDataProvider we hidden all basic IO operation and provide the local file database operator, like
HashObject,GetObject,Get/Update/Delete ref and so on.
We leverage System.IO.Abstractions to make
ugit testable and injectable. Besides the
ugit file database operator, the
IFileOperator also exposes some primitive IO operation.
Implement Git by yourself (1: Introduction)
I’d like to say that Git is the most popular version control system (VCS). As a developer, you probably use git porcelain commands in your daily work and treat it as black box. But
If you can’t make one, you don’t know how it works.
You can access to git source code though, it’s a little bit of challenge to go through this repo now. What’s worse, git is written in C language which is sophisticated for us. Git is also Linus Torvalds’s masterpiece. It contains a lot of tricky code.
The On-Behalf-Of flow is used in the case where an application invokes a service/web API, which in turn needs to call another service/web API. The idea is to propagate user identity and permissions through the request chain.
At this point, the application has an access token for API A( token A) with the user’s claim and consent to access the middle-tier web API (API A). Now the API A needs to make an authenticated request to the downstream web API （API B).
Now, I’d like to create web application that will retrieve the user’s profile from Microsoft Graph.
Authentication is the process of proving you are who you say you are. The common used protocol is OpenID Connect. While Authorization is the act of granting an authenticated party permission to do something, which is implemented by OAuth 2.0 protocol.
Before exploring these two protocol flows, let’s have a quick look of parties involved in.
Calculator is a common tool for us to get the arithmetic expression’s result. In *NIX OS, once you type bc command, then you get into calculating environment. Feel free to input any legal arithmetic expressions.
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.This is free software with ABSOLUTELY NO WARRANTY.For details type `warranty'.
Let’s dive into what’s going on when you type string(aka arithmetic expression) then it feeds back the result. If you’re familiar with Python, it provides a interactive console which you can type any Python’s statements, including the above arithmetic expression.
A software developer in Microsoft at Suzhou