30 热度

Handle HTTP Status Codes With Razor Pages

In this post, we’ll see how we can use a middleware to process status codes respectfully so that both humans and our web clients get the necessary information necessary to take the next step.

收录时间: 2020-08-06
分类: ASP.NET Core
贡献者: Rector
32 热度

asp.net core 3.1多种身份验证方案,cookie和jwt混合认证授权

开发了一个公司内部系统,使用asp.net core 3.1。在开发用户认证授权使用的是简单的cookie认证方式,然后开发好了要写几个接口给其它系统调用数据。并且只是几个简单的接口不准备再重新部署一个站点,所以就直接在MVC的项目里面加了一个API区域用来写接口。这时候因为是接口所以就不能用cookie方式进行认证,得加一个jwt认证,采用多种身份验证方案来进行认证授权。认证授权身份验证是确定用户身份的过程。 授权是确定用户是否有权访问资源的过程。 在 ASP.NET Core 中,身份验证由 IAuthenticationService 负责,而它供身份验证中间件使用。 身份验证服务会使用...

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

可能是Asp.net Core On host、 docker、kubernetes(K8s) 配置读取的最佳实践

可能很多新手都会遇到同样的问题:我要我的Asp.net Core 应用传统方式直接部署(host),docker部署(docker-compose),kubernetes(以下称k8s)下部署,都用统一的方式读取配置,怎么实现呢?大家知道,我们默认平时配置文件以appsettings.json 、appsettings.{EnvironmentName}.json 形式存在,这样在host方式下面没有问题,但在docker下,如果直接把配置打包到镜像,那每次改一下下配置就需要重新打包,那成本太大了。另外在k8s下面又有Secret、ConfigMap等多种方式管理配置,如何把多种配置存储和读取,有机结合、同一份代码统一管理使用,是我们今天的主题。

收录时间: 2020-08-05
分类: ASP.NET Core
贡献者: Rector
29 热度

asp.net core 3.1 自定义中间件实现jwt token认证

asp.net core 3.1 自定义中间件实现jwt token认证...

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

Blazor WebAssembly Registration Functionality with ASP.NET Core Identity

In this article, we are going to learn how to implement Blazor WebAssembly registration functionality to create a new user for our application. We are going to integrate the ASP.NET Core Identity library to help us in a process. After the Identity integration, we are going to create a registration functionality on the server-side and after that the Blazor WebAssembly registration form for our users to interact with.

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

RELEASE: ASP .NET Core 3.1 A-Z eBook

As promised, below is the initial release of the ASP .NET Core 3.1 A-Z ebook. This combines the 26 blog posts from the series of ASP .NET Core articles on this website...

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

Using the nameof C# keyword with ASP.NET 3 IUrlHelper

I recently spent a couple of hours yak-shaving, and despite much Googling couldn't find any help on the internet. I'm surprised that the following problem turned out to be so difficult to figure out, so it may just be that I'm ignorant or that my web search skills failed me that day. On the other hand, if this really is as difficult as I found it, perhaps this article can save some other poor soul an hour or two.

收录时间: 2020-08-04
分类: ASP.NET Core
贡献者: Rector
46 热度

JWT Auth in ASP.NET Core

In this article, I will show you how to implement an ASP.NET Core web API application using JWT authentication and authorization. This web API application implements processes such as login, logout, refresh token, impersonation, and so on. The following screenshot shows the API endpoints that we are going to walk through in this article.

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

Handling concurrency in an ASP.NET Core Web API with Dapper

In this post, we will cover how to handle concurrency for a resource in an ASP.NET Core Web API. The endpoint we will focus on is updating a product resource. The product lives in a SQL Server database and we access it with Dapper. We will handle the case when requests are trying to update the product at the same time.

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

Asp.net Core 3.1基于AspectCore实现AOP,实现事务、缓存拦截器

最近想给我的框架加一种功能,就是比如给一个方法加一个事务的特性Attribute,那这个方法就会启用事务处理。给一个方法加一个缓存特性,那这个方法就会进行缓存。这个也是网上说的面向切面编程AOP。AOP的概念也很好理解,跟中间件差不多,说白了,就是我可以任意地在方法的前面或后面添加代码,这很适合用于缓存、日志等处理。

收录时间: 2020-07-27
分类: ASP.NET Core
贡献者: Rector
84 热度

Asp.NetCore3.1 WebApi 使用Jwt 授权认证使用

Asp.NetCore3.1 WebApi 使用Jwt 授权认证使用

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

Creating a custom endpoint visualization graph: Visualizing ASP.NET Core 3.0 endpoints using GraphvizOnline - Part 4

In this series, I've been laying the groundwork for building a custom endpoint visualization graph, as I showed in my first post. This graph shows the different parts of the endpoint routes: literal values, parameters, verb constraints, and endpoints that generate a result...

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

Microservice Architecture in ASP.NET Core with API Gateway

This is a beginner friendly article, which means that if you have absolutely NO idea about Microservices, I can guarentee you that you would gain enough knowledge by the end of this article and you would probably be confident enough to start building your own simple Microservice Architecture in ASP.NET Core.

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

Swagger in ASP.NET Core: Tips & Tricks

This post contains a few tips and tricks that can help you transform your swagger UI into an interactive documentation. If you don’t yet know how to install swagger in ASP.NET Core, this post will help you Get started with Swagger and ASP.NET Core.

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

Dapper in ASP.NET Core with Repository Pattern

In this article, we will learn all about Dapper in ASP.NET Core and make a small implementation to understand how it works. Let’s not limit it just with Dapper. We will build an application that follows a very simple and clean Architecture. In this implementation we will try to under Repository Pattern and Unit Of Work as well. Everything put together, this article helps you to understand How Dapper can be used in an ASP.NET Core Application following Repostitory Pattern and Unit of Work. Here is the source code of the entire implementation. Let’s get started.

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

How to Use and Unit Test ILogger

ILogger is at the heart of the ASP.NET Core infrastructure and works well when you use it correctly. If you approach it the wrong way, it is easy to go down a rabbit hole and burn lots of time trying to implement basic functionality. Follow these tips instead. This article gives you the basics on how to use and verify mocked calls without having to implement a class yourself.

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

ASP.Net Core 3.1 With Autofac ConfigureServices returning an System.IServiceProvider isn't supported

Autofac在ASP.Net Core3.0以后,集成方式有所调整。在ASP.Net Core2中我们一般是把Startup的ConfigureServices方法返回值类型改为IServiceProvider。我们可以先看一下部分代码...

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

Microservices with ASP.NET Core 3.1

Microservices is a type of Architecture in which application is created as multiple small independent serviceable components. This article will cover in detail how to create microservices with ASP.NET Core, Serilog, Swagger UI, Health Checks & Docker containers.

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

Sort Data With ASP.NET Core and Query Strings

Anyone building a web application will eventually have to deal with sorting tabular data. It’s a rule established into the constitution of the internet (if there was one). While it may be simple in concept, its implementation can be daunting based on many application-specific factors. In this post, we’ll see how we can work our way from C# implementation, to ASP.NET Core Razor Pages, and finally in the UI/UX elements of our page.

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

Building an ASP.NET Core Backend for Angular Applications

TX Text Control for Angular requires a backend for the document editor and viewer. This step-by-step walkthrough shows how to create the ASP.NET Core backend.

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