20 热度

ASP.NET Core AutoWrapper 自定义响应输出

AutoWrapper是一个简单可自定义全局异常处理程序和ASP.NET Core API响应的包装。他使用ASP.NET Core middleware拦截传入的HTTP请求,并将最后的结果使用统一的格式来自动包装起来.目的主要是让我们更多的关注业务特定的代码要求,并让包装器自动处理HTTP响应。这可以在构建API时加快开发时间,同时为HTTP响应试试我们统一的标准。

收录时间: 2020-03-31
分类: ASP.NET Core
贡献者: Rector
13 热度

ASP.NET MVC升级到ASP.NET Core MVC踩坑小结

ASP.NET Core是微软新推出的支持跨平台、高性能、开源的开发框架,它的优势不必多说,因为已经说得太多了。当然,现在依然有着数量庞大的系统运行于.NET Framework上,由于有大量的Break Changes,很多项目项目团队也不敢贸然升级,其中的考量也不全部是技术原因,更多的可能还是业务推进因素。小编自年前开始考虑升级一套电商系统,原先是基于.NET Framework 4.5的,打算直接升级到.NET Core 3.1,由于系统规模比较庞大,所以一旦开工就是一个漫长的工程,我的博客也在很长时间没有再更新,有点对不起读者了。年前第一次重构时,由于低估这套系统的复杂性再加上...

收录时间: 2020-03-31
分类: ASP.NET Core
贡献者: Rector
16 热度

Middleware in ASP .NET Core 3.1

This is the thirteenth of a new series of posts on ASP .NET Core 3.1 for 2020. In this series, we’ll cover 26 topics over a span of 26 weeks from January through June 2020, titled ASP .NET Core A-Z! To differentiate from the 2019 series, the 2020 series will mostly focus on a growing single codebase (NetLearner!) instead of new unrelated code snippets week.

收录时间: 2020-03-31
分类: ASP.NET Core
贡献者: Rector
10 热度

IdentityServer4 Integration with ASP.NET Core

In this article, we are going to learn about IdentityServer4 Integration with ASP.NET Core project. We are going to start with some explanations related to JWT, OAuth, OpenIdConnect, and Endpoints, to get familiar with the basics. After the theory part, we are going to jump into the code and explain...

收录时间: 2020-03-31
分类: ASP.NET Core
贡献者: Rector
21 热度

Asp.Net Core 中IdentityServer4 实战之角色授权详解

前几篇文章分享了IdentityServer4密码模式的基本授权及自定义授权等方式,最近由于改造一个网关服务,用到了IdentityServer4的授权,改造过程中发现比较适合基于Role角色的授权,通过不同的角色来限制用户访问不同的Api资源,这里我就来分享IdentityServer4基于角色的授权详解。

收录时间: 2020-03-30
分类: ASP.NET Core
贡献者: Rector
17 热度

Hosting and ASP.NET Core API in a Container Part 1 of 2 - Building the Container

App Dev Manager Greg Roe explores hosting cross platform ASP.NET Core Applications with containers in this two part series.

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

ASP.NET Core 3.x 中间件流程与路由体系

ASP.NET Core 中间件的配置方法可以分为以上三种,对应的Helper方法分别是:Run(), Use(), Map()。Run(),使用Run调用中间件的时候,会直接返回一个响应,所以后续的中间件将不会被执行了。Use(),它会对请求做一些工作或处理,例如添加一些请求的上下文数据,有时候甚至什么也不做,直接把请求交给下一个中间件。Map(),它会把请求重新路由到其它的中间件路径上去。实际中呢,Use()这个helper方法用的最多...

收录时间: 2020-03-28
分类: ASP.NET Core
贡献者: Rector
24 热度

A Lesson Learnt: Test Explorer Processor Architecture Settings

I recently posted about the process to upgrade from ASP.NET Core 3.1 to ASP.NET Core 5.0 (preview 1) and mentioned that I had an issue with running my unit tests from Visual Studio 16.6 (preview 1).

收录时间: 2020-03-28
分类: ASP.NET Core
贡献者: Rector
18 热度

gRPC & ASP.NET Core 3.1: How to create a gRPC service ?

gRPC & ASP.NET Core 3.1: How to create a gRPC service ?

收录时间: 2020-03-26
分类: ASP.NET Core
贡献者: Rector
23 热度

Logging in ASP .NET Core 3.1

This is the twelfth of a new series of posts on ASP .NET Core 3.1 for 2020. In this series, we’ll cover 26 topics over a span of 26 weeks from January through June 2020, titled ASP .NET Core A-Z! To differentiate from the 2019 series, the 2020 series will mostly focus on a growing single codebase (NetLearner!) instead of new unrelated code snippets week.

收录时间: 2020-03-25
分类: ASP.NET Core
贡献者: Rector
19 热度

Easily adding Security Headers to your ASP.NET Core web app and getting an A grade

That's my podcast website with an F rating from SecurityHeaders.com. What's the deal? I took care of this months ago! Turns out, recently I moved from Windows to Linux on Azure. If I am using IIS on Windows, I can (and did) make a section in my web.config that looks something like ...

收录时间: 2020-03-24
分类: ASP.NET Core
贡献者: Rector
21 热度

Hide actions from Swagger / OpenAPI documentation in ASP.NET Core

Recently a question was asked on Stack Overflow about the ability to hide particular controllers from Swagger documentation: https://stackoverflow.com/q/60667324/1658906. I wrote an answer with the first method that I'm aware of...

收录时间: 2020-03-23
分类: ASP.NET Core
贡献者: Rector
38 热度

Asp.Net Core 中IdentityServer4 实战之 Claim详解

ids4授权服务中构建用户身份信息通过身份容器载体ClaimsPrincipal载入(具体载入到哪里?是怎么携带到Api资源网关中的?下篇文章再来分享具体的原理和流程);再经过受保护的Api资源网关中通过ClaimsPrincipal身份容器载体获得当前用户的相关信息后就可以做一...

收录时间: 2020-03-23
分类: ASP.NET Core
贡献者: Rector
31 热度

HTML Buttons Are Under-Appreciated In ASP.NET Core

TML buttons are one of the most under-appreciated components of modern web forms. ASP.NET Core developers see the button as a way to submit a form of input elements like text boxes, selects, and radio buttons. I’m here to tell you that buttons are so much more versatile. In this short post, I’ll write a simple yet fun guessing game using ASP.NET Core Razor Pages, HTML, and CSS.

收录时间: 2020-03-21
分类: ASP.NET Core
贡献者: Rector
33 热度

Resolving the current route/endpoint name in ASP.NET Core 3.1

Endpoint routing was first introduced in ASP.NET Core 2.2 with the goal of making routing a cross-cutting concern, decoupling it from the MVC framework. You can find a detailed write-up on endpoint routing here.

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

Using a Web.config File With ASP.NET Core

One of the most significant changes for those that transitioned from ASP.NET to ASP.NET Core was the transition of configuration information from the web.config file to the appsettings.json file. However, for those of us still deploying our applications to IIS, there are many reasons that we might want to include a web.config with our apps.

收录时间: 2020-03-20
分类: ASP.NET Core
贡献者: Rector
42 热度

ASP.NET Core 5 Features - Introducing HttpProtocol

In this blog post, which will be a quick read, I’m going to begin what I expect to be a long-running endeavour, to dig into new APIs available in .NET 5 and ASP.NET Core 5.0. This time, I’m going to look at a new helper for HTTP protocol versions.What are HTTP Protocol Versions?Through the years...

收录时间: 2020-03-19
分类: ASP.NET Core
贡献者: Rector
35 热度

Using query strings in ASP.NET Core unit tests

Using query string in controller unit tests is actually easy until we don’t need anything more advanced. We can buld up a string with query parameters and go with it. But what if things get more complex and we need encoding or multiple values? Here’s how to build safe query string for ASP.NET COre controller unit tests.

收录时间: 2020-03-19
分类: ASP.NET Core
贡献者: Rector
42 热度

ASP.NET Core updates in .NET 5 Preview 1

.NET 5 Preview1 is now availableand is ready for evaluation! .NET 5 will be a current release. To get started with ASP.NET Core in .NET 5.0 install the .NET 5.0 SDK. If you’re on Windows using Visual Studio, we recommend installing the latest preview of Visual Studio 2019 16.6.Upgrade...

收录时间: 2020-03-18
分类: ASP.NET Core
贡献者: Rector
42 热度

Upgrading from ASP.NET Core 3.1 to 5.0 (Preview 1)

In this post, I want to take a look at the steps required to upgrade some projects to the first preview of .NET 5and ASP.NET Core 5.0. Both were released yesterday (16th March 2020) and are the first public previews we have available for these future versions. The .NET 5 roadmap has these scheduled ...

收录时间: 2020-03-18
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助