We did a live stream where we integrated SignalR with ASP.NET Core and React. We went ahead and built a system where you can send messages in a React app. From there, it used SignalR to send the message to the ASP.NET Core app. Once the ASP.NET Core app got the message, it sent it’s own message back to the React app. We are going to recap on the steps we went through in that demo to successfully integrate SignalR with React and ASP.NET Core.
In this post I show how the endpoint routes in an ASP.NET Core 3.0 application can be visualized using the GraphvizOnline service. That lets you create diagrams like the following, which describe all the endpoints in your application...
In this post, we are going to create a multi-tenant ASP.NET Core web API by leveraging Dapper and SQL Server Row Level Security (RLS).
全局异常处理是我们编程过程中不可或缺的重要环节。有了全局异常处理机制给我们带来了很多便捷，首先我们不用满屏幕处理程序可能出现的异常，其次我们可以对异常进行统一的处理，比如收集异常信息或者返回统一的格式等等。ASP.NET Core为我们提供了两种机制去处理全局异常，一是基于中间件的方式，二是基于Filter过滤器的方式。Filter过滤器的方式相对来说比较简单，就是捕获Action执行过程中出现的异常，然后调用注册的Filter去执行处理异常信息，在这里就不过多介绍这种方式了，接下来我们主要介绍中间件的方式。异常处理中间件ASP.NET Core为我们提供了几种不同处理异常方式的中间件分别...
This is the twenty-sixth of a new series of posts on ASP .NET Core 3.1 for 2020. In this series, we’ve covered 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 mostly focused on a growing single codebase (NetLearner!) instead of new unrelated code snippets week.
This post might seem bizzare at first. In fact the idea of writing this article did not come to me on my own. The original idea came from a James Newton King tweet, this last is offering a way to write an API in the simplest possible way, efficient and without any particular framework. I found it cool and that’s why I’m making it a post today. Here is his original tweet: https://twitter.com/JamesNK/status/1276450146365001728
Sometimes your API needs to expose a non-primitive type that has a “natural” string representation. For instance, a standard representation for a duration is the ISO 8601 format, where “1 month, 2 days, 3 hours and 4 minutes” can be represented as P1M2DT3H4M (note that this isn’t the same as a Timespan, which has no notion of calendar months and years). A duration could be represented in C# as a custom type, like the Duration structure in my Iso8601DurationHelper project. I’ll use this as an example for the rest of this post.
I've been pointed to StreamJsonRpc library through a comment under one of my posts and I've decided it's something worth taking a look at. StreamJsonRpc is a .NET Standard implementation of JSON-RPC 2.0 wire protocol.
.NET 5 Preview 6 is now availableand is ready for evaluation. Here’s what’s new in this release:Blazor WebAssembly template now includedJSON extension methods for HttpRequest and HttpResponseExtension method to allow anonymous access to an endpointCustom handling of authorization failuresSignalR Hub...
This is the twenty-fifth 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.
The Manning Early Access Program (MEAP) has started for the second edition of my book ASP.NET Core in Action, Second Edition. This post gives you a sample of what you can find in the book. If you like what you see, please take a look - for now you can even get a 40% discount with the code bllock2. On top of that, you'll also get a copy of the first edition, free!
In this article, We will talk about Onion Architecture In ASP.NET Core and it’s advantages. We will also together build a WebApi that follows a variant of Onion Architecture so that we get to see why it is important to implement such an architecture in your upcoming projects. You can find the source code of this implementation on my GitHub.
In this post, we’ll explore an existing ASP.NET MVC application, begin to migrate it to Razor Pages, and see where Razor Pages may not be a good fit.
在我的项目中有mvc controller(view 和 razor Page)同时也有webapi,那么就需要网站同时支持2种认证方式,web页面的需要传统的cookie认证,webapi则需要使用jwt认证方式,两种默认情况下不能共存,一旦开启了jwt认证,cookie的登录界面都无法使用,原因是jwt是验证http head "Authorization" 这属性.所以连login页面都无法打开.
This is the twenty-fourth 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.
This short article shows how to display images stored in a database in a Razor Pages application using the Bootstrap Carousel and Entity Framework Core.
This will be the third post on OData and ASP.NET Core 3. Please find the first post (basics) here and the second post (querying) here. This time, I will talk about actions and functions. For demo purposes, let’s consider this domain model...