29 热度

將 ASP.NET Core 6 轉成 Windows Service

昨天介紹了只用 50 行的 Program.cs 程式寫出一個支援 CORS 上傳案的 ASP.NET Core 服務,下一步我想把它轉成 Windows Service 常駐執行。

收录时间: 2022-01-20
分类: ASP.NET Core
贡献者: Rector
35 热度

用 50 行 Program.cs 寫個 ASP.NET Core CORS 上傳服務

寫 JavaScript 在別人家的網頁跑,若想將產生結果存成本機檔案,有一些做法,例如:產生一個 href 為 Data URI 的連結供點選下載(範例:用 100 行實現 HTML5 可存檔塗鴉版)、靠伺服器端程式實現自動下載 (範例:Canvas.toDataURL()另存檔案)... 等等。但想要做到不知不覺將檔案寫到本機的指定資料夾,基於安全考量,通常會被瀏覽器禁止。

收录时间: 2022-01-20
分类: ASP.NET Core
贡献者: Rector
33 热度

Required Query String Parameters in ASP.NET Core

In this article, we’re going to talk about required query string parameters. We are going to learn how to make query string parameters mandatory and explore the options we have in ASP.NET Core.

收录时间: 2022-01-18
分类: ASP.NET Core
贡献者: Rector
71 热度

API Versioning in ASP.NET Core

In this article, we’re going to talk about API versioning and explore the options we have in ASP.NET Core.To download the source code for this article, you can visit our GitHub repository.

收录时间: 2022-01-12
分类: ASP.NET Core
贡献者: Rector
82 热度

Building ASP.NET Core and EF Core multi-tenant apps – Part1: the database

This article focuses on setting up a database to use in a multi-tenant application so that each tenant’s data is separate from other tenants. The approach described uses ASP.NET Core, EF Core and the AuthP library.

收录时间: 2022-01-05
分类: ASP.NET Core
贡献者: Rector
63 热度

Secure a Blazor WASM ASP.NET Core hosted APP using BFF and OpenIddict

This article shows how to implement authentication and secure a Blazor WASM application hosted in ASP.NET Core using the backend for frontend (BFF) security architecture to authenticate. All security is implemented in the backend and the Blazor WASM is a view of the ASP.NET Core application, no security is implemented in the public client. The application is a trusted client and a secret is used to authenticate the application as well as the identity. The Blazor WASM UI can only use the hosted APIs on the same domain.

收录时间: 2022-01-04
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助
63 热度

Deploy ASP.NET CORE Applications on Centos 8

A couple of weeks ago I needed to deploy an ASP.NET Core application on a centos 8 machine and that was the first time I wanted to use Linux because I had no experience working with Linux, it took me a whole day to finish this task. In this article, I am going to share whatever you need to know about deploying the asp.net core application on a Linux machine.

收录时间: 2021-12-27
分类: ASP.NET Core
贡献者: Rector
47 热度

Cookie Authentication in ASP.NET 5

I’ve used ASP.NET (Core) Security and Identity for over a decade. This Twitter thread sums it up…Identity is hard! And ASP.NET hasn’t a great answer (IMO). I made time to think about security in more detail for my SaaS company. I’ve got a basic set of requirements, so I want a simple implementation.

收录时间: 2021-12-27
分类: ASP.NET Core
贡献者: Rector
70 热度

Using Authorization with Swagger in ASP.NET Core

In this article, we are going to look at how to implement swagger authorization in an ASP.Net Core Web API application. We are only going to cover how to set up swagger to accept JSON Web Token (JWT) and how to utilize the token generated to access restricted resources in Swagger. That said, if you are not familiar with the JWT authentication, you can check out our articles ASP.NET Core Authentication One and ASP.NET Core Authentication Two for more information.

收录时间: 2021-12-24
分类: ASP.NET Core
贡献者: Rector
107 热度

Using Minimal APIs in ASP.NET Core Razor Pages

If you are using ASP.NET Core Razor Pages to develop your web application, you have already decided that the majority of your HTML will be generated on the server. Nevertheless, chances are that you will want to introduce some client side operations into the application to improve its user friendliness in places. If those operations involve data, you will probably want to work with JSON. From .NET 6, you can use a simplified minimal request handler API that works with JSON by default.

收录时间: 2021-12-16
分类: ASP.NET Core
贡献者: Rector
149 热度

Implement Compound Proof BBS+ verifiable credentials using ASP.NET Core and MATTR

This article shows how Zero Knowledge Proofs BBS+ verifiable credentials can be used to verify credential subject data from two separate verifiable credentials implemented in ASP.NET Core and MATTR. The ZKP BBS+ verifiable credentials are issued and stored on a digital wallet using a Self-Issued Identity Provider (SIOP) and OpenID Connect. A compound proof presentation template is created to verify the user data in a single verify.

收录时间: 2021-12-14
分类: ASP.NET Core
贡献者: Rector
89 热度

Test run of HTTP Logging in ASP.NET Core 6

Ever wanted to log all HTTP requests to your websites? I sure have and I have been implemented various solutions for doing so for years. From HTTP modules in ASP.NET to request logging middleware in ASP.NET Core. With ASP.NET Core, we now have request logging built-in. Stay tuned to learn more.

收录时间: 2021-12-13
分类: ASP.NET Core
贡献者: Rector
74 热度

Handling file uploads in Open API with ASP.NET Core

This post is about implementing handling file uploads in Open API with ASP.NET Core. Open API is one way to document REST API endpoints. When we using Web API and IFormFile class to upload a file, Open API will display a File Upload control in the UI like this.

收录时间: 2021-12-13
分类: ASP.NET Core
贡献者: Rector
93 热度

ASP.NET Core 6 and IAsyncEnumerable - Receiving Async Streamed JSON in Blazor WebAssembly

Back in July, I've shared my experiments around new JSON async streaming capabilities in ASP.NET Core 6. Last week I've received a question about utilizing these capabilities in the Blazor WebAssembly application. The person asking the question has adopted the DeserializeAsyncEnumerable based client code, but it didn't seem to work properly. All the results were always displayed at once. As I didn't have a Blazor WebAssembly sample as part of my streaming JSON objects demo, I've decided I'll add one and figure out the answer to the question along the way.

收录时间: 2021-12-07
分类: ASP.NET Core
贡献者: Rector
106 热度

Clean Architecture with ASP.NET Core

I late 2021, I presented a 30-minute session at dotNetConf on the topic of Clean Architecture with ASP.NET Core 6. At the time of writing this 2 weeks later, the video has 82k views, making it the most-watched YouTube video of the conference (not necessarily during the live event). You can check it out here if you're interested. In this article, I want to go into a bit more depth on the topic of Clean Architecture with ASP.NET Core.

收录时间: 2021-12-03
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助
117 热度

Dependency Injection Lifetimes in ASP.NET Core

While registering our services in the ASP.NET Core DI container, we can configure them with different lifetimes. In this article, we are going to talk about the different dependency injection lifetimes.

收录时间: 2021-11-25
分类: ASP.NET Core
贡献者: Rector
113 热度

理解ASP.NET Core - 错误处理(Handle Errors)

开发人员异常页用于显示未处理的请求异常的详细信息。当我们通过ASP.NET Core模板创建一个项目时,Startup.Configure方法中会自动生成以下代码...

收录时间: 2021-11-23
分类: ASP.NET Core
贡献者: Rector
91 热度

Using Multiple Databases in ASP.NET Core via Entity Framework Core

In this article, we are going to learn how to add multiple databases in the ASP.NET Core project using Entity Framework Core. We are going to show you how our repository pattern implementation helps us in the process by using abstractions that will hide all the implementation details from the presentation layer. Since we already have the repository pattern explained in our ASP.NET Core Repository Pattern article, we strongly suggest reading it first to learn more about the repository pattern implementation in ASP.NET Core Web API. We will modify the source code from that project and show you the benefits of the implementation of that pattern when adding multiple databases in an ASP.NET Core project.

收录时间: 2021-11-17
分类: ASP.NET Core
贡献者: Rector
129 热度

Back to Basics: Add an ASP.NET Runtime Information Startup Banner

For every .NET Core Console/Web application that I run, I add a little startup banner at the bottom of the startup code to provide basic runtime information about the application starting up. This is useful so I can see at a glance what I'm running. This seems obvious, but sometimes it's actually not and having the banner there makes sure I can see that I'm running on the right runtime and - more importantly - in the Environment configuration - Production or Development - I'm expecting.

收录时间: 2021-11-11
分类: ASP.NET Core
贡献者: Rector
138 热度

ASP.NET Core scheduling with Quartz.NET and SignalR monitoring

This article shows how scheduled tasks can be implemented in ASP.NET Core using Quartz.NET and then displays the job info in an ASP.NET Core Razor page using SignalR. A concurrent job and a non concurrent job are implemented using a simple trigger to show the difference in how the jobs are run. Quartz.NET provides lots of scheduling features and has an easy to use API for implementing scheduled jobs.

收录时间: 2021-11-09
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助