595 热度

Clean way to add Startup class in ASP.NET Core 6

If you are following ASP.NET Core 6, then probably you are aware that with ASP.NET Core 6.0 projects, there is no Startup.cs file. It is now combined with Program.cs file to bring unified experience. I posted about How to Add Startup.cs in ASP.NET Core 6 Project and this approach brings Startup.cs class in the project in a traditional way that we have today with ASP.NET Core 5 and it’s prior version. But what if we can improve things and make it better. Well, in this post, let’s take a look at a clean way to add Startup class in ASP.NET Core 6 projects.

收录时间: 2022-06-07
分类: ASP.NET Core
贡献者: Rector
795 热度

How to add Swagger to ASP.NET Core 6 Application

Swagger is very popular and doesn’t need an introduction. It helps you to test your API. Earlier, I posted about how to add Swagger to ASP.NET Core 2.0 web API and those steps still works for ASP.NET Core 5 based applications where you bring Swashbuckle nuget packages and then add code to Startup.cs file to enable Swagger. But with ASP.NET Core 6, things have become a little easy and time saving. Now you can easily add swagger to ASP.NET Core 6 application with a mouse click.

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

Understanding PathBase in ASP.NET Core

In this post I'll describe a lesser-known property on HttpRequest called PathBase. I describe what it does, when it's useful, and how to use it.

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

Response Caching in ASP.NET Core

In this article, we are going to discuss how response caching works in ASP.NET Core.

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

How to Block IP Addresses in ASP.NET Core Web API

In this article, we are going to learn how to block IP addresses in ASP.NET Core Web API. This demo makes use of the reverse proxy tool ngrok when testing, but you can use your local IP address as well. If using ngrok for the first time, you will be required to sign up for a free account.

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

How to Add Startup.cs in ASP.NET Core 6 Project

With ASP.NET Core 6.0 projects, you will not find Startup.cs file. By default, this file is removed and Program.cs is the new place where you need to register your dependencies and Middleware. But if you are a fan of Startup.cs or upgrading your project to ASP.NET Core 6.0, you might want back the Startup.cs file. So in this post, let’s find out how to add Startup.cs in ASP.NET Core 6 project.

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

Implementing API Gateway with Ocelot in ASP.NET Core

In this article, we are going to learn how to implement an API Gateway using Ocelot. Ocelot is an open-source API Gateway, designed for microservices architecture. We already have an article about API Gateway, where we explained a lot about this subject. So, if you are not that familiar with the topic and microservices overall, we strongly suggest reading the linked article first.

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

Asp.Net Core 7 preview 4 重磅新特性--限流中间件

限流是应对流量暴增或某些用户恶意攻击等场景的重要手段之一,然而微软官方从未支持这一重要特性,AspNetCoreRateLimit这一第三方库限流库一般作为首选使用,然而其配置参数过于繁多,对使用者造成较大的学习成本。令人高兴的是,在刚刚发布的.NET 7 Preview 4中开始支持限流中间件。UseRateLimiter尝鲜安装.NET 7.0 SDK(v7.0.100-preview.4)通过nuget包安装Microsoft.AspNetCore.RateLimiting创建.Net7网站应用,注册中间件全局限流并发1个app.UseRateLimiter(new RateLimi...

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

Testing ASP.NET Core gRPC services in JetBrains Rider

I was recently chatting to Dan Clarke for the Unhandled Exception podcast, and the topic of testing gRPC endpoints came up. Dan wondered if there was an equivalent of Postman for gRPC, and it turns out that Postman itself supports gRPC!

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

How to Return HTML From ASP.NET Core Web API

A typical web API returns JSON or XML responses. However, rare cases exist where we need to return responses in other formats. In this article, we are going to learn how to return HTML from ASP.NET Core Web API. We will also state some use cases for this type of API.

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

How to Add Multiple POST Actions in ASP.NET Core Web API

In this article, we are going to see how to add multiple POST actions to our Web API controller. For the demonstration, we are going to use the .Net 6 Web API project.

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

Long-Running Tasks in a Monolith ASP.NET Core Application

Often we come across scenarios where invoking a Web API endpoint triggers long-running tasks. In this article, we’re going to explore the different ways we can implement such a long-running task in an ASP.NET Core Web API.

收录时间: 2022-04-28
分类: ASP.NET Core
贡献者: Rector
1382 热度

Why isn't my ASP.NET Core app in Docker working?

In this post I describe a problem I ran into the other day that had me stumped briefly—why doesn't my ASP.NET Core app running in Docker respond when I try and navigate to it? The problem was related to how ASP.NET Core binds to ports by default.

收录时间: 2022-04-27
分类: ASP.NET Core
贡献者: Rector
1217 热度

Distributed Caching in ASP.NET Core

In this article, we are going to learn what Distributed Caching is and how to implement distributed caching in an ASP.NET Core application.

收录时间: 2022-04-26
分类: ASP.NET Core
贡献者: Rector
923 热度

Combining Bearer Token and Cookie Authentication in ASP.NET

And we're back for another episode in the seedy TV drama that is ASP.NET Authentication. In today's show we'll discuss the mysterious case of combining multiple authentication schemes in a single application. Tune in at 11 for the scary conclusion...

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

Optional Parameters in ASP.NET Core Web API Routing

In this article, we are going to look at how to use optional parameters in ASP.NET Core Web API routing. Additionally, we are going to learn how to use optional parameters with route constraints.To download the source code for this article, you can visit our GitHub repository.Let’s start...

收录时间: 2022-03-29
分类: ASP.NET Core
贡献者: Rector
1302 热度

Health Checks in ASP.NET Core

In this article, we are going to look into Health Checks in ASP.NET Core. Then we are going to look into the Health Checks Middleware provided by ASP.NET Core to create some checks and add a nice dashboard to view all our Health Checks. Finally, we will briefly look at some ways to make our Health Check endpoints more secure.

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

Using MassTransit with RabbitMQ in ASP.NET Core

In this article, we are going to take a look at how we can use the open-source, distributed application library MassTransit in conjunction with RabbitMQ in an ASP.NET Core application. First, we are going to cover some of the more advanced RabbitMQ features, as well as some of the concepts we will come across in the MassTransit library. Finally, we will learn how to use these libraries in an ASP.NET Core Web API application.

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

How to Use RabbitMQ in ASP.NET Core

In this article, we are going to take a look at using a message broker, RabbitMQ, with an ASP.NET Core Web API application. Message brokers are applications that allow other applications to send and receive messages in an asynchronous manner. As a result of this, we can build highly scalable, decoupled applications that don’t rely on synchronous actions, such as HTTP, to communicate. We can use any binary encoded data as a message to send between one application to another.

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

Rate Limiting in ASP.NET Core Web API

In this article, we’re going to talk about Rate Limiting in ASP.NET Core and explore some ways of implementing it.

收录时间: 2022-02-24
分类: ASP.NET Core
贡献者: Rector
AD 友情赞助