22 热度

Should you use the Repository Pattern? With CQRS, Yes and No!

The repository pattern is polarizing. Some developers swear you should always use it to abstract data access logic while others think it’s unnecessary if you’re using an ORM. So should you use it? My answer is Yes and No! If you’re applying CQRS and Vertical Slice Architecture you’ll likely want a repository to build up Aggregates. However, for a Query, you may want to just get the data you need rather than an entire aggregate (or collection of aggregates) to build a view model.

收录时间: 2021-12-03
分类: 架构设计
贡献者: Rector
24 热度

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
23 热度

Introducing the new Razor editor in Visual Studio 2022

With the release of Visual Studio 2022 you can now use the new Razor editor for local ASP.NET Core development with MVC, Razor Pages, and Blazor. Download Visual Studio 2022 and make sure to update to 17.0.2 to get the latest Razor updates.

收录时间: 2021-12-03
分类: Visual Studio
贡献者: Rector
35 热度

Upgrading a .NET 5 "Startup-based" app to .NET 6 Exploring .NET Core 6 - Part 12

In this short post I tackle a question I have received several times—"how can I update an ASP.NET Core 5 app that uses Startup to .NET 6's minimal hosting APIs"?

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

A .NET 5.0 Guide: From Idea To NuGet Package

As technology evolves and we progress as a community, I notice that older blog posts erode in their helpfulness. One of the topics I find myself constantly having to relearn, especially as an OSS author, is the ability to start a new project, build a continuous integration pipeline, and get my package to NuGet. It’s essential to understand how to design a workflow that works with your project, and in this post, we’ll take a step-by-step walkthrough of how to do just that.

收录时间: 2021-11-30
分类: .NET 5
贡献者: Rector
30 热度

Get to Know EF Core 6

The Entity Framework Core team has released the generally available version of EF Core 6.0 in parallel with .NET 6. EF Core 6 is available as a set of NuGet Packages. At the end of this blog post you will find a packages section that lists all of the available packages and describes what they are used for.

收录时间: 2021-11-30
分类: EF Core
贡献者: Rector
AD 友情赞助
54 热度

.NET 开源免费图表组件库,Winform,WPF 通用

今天给大家介绍一个功能完善, 性能强悍的图表组件库 ScottPlot, 当我第一次在 github 上看到这个库, 我看不懂,但我大受震撼, 这么好的项目当然要分享出来了。https://github.com/ScottPlot/ScottPlotScottPlot 是一个 .NET 图表组件, 主要有以下特点:适用范围广:同时适用于 WinForms, WPF, Avalonia, Console, 支持 .NET Framework 4.6.1 及以上, NET Core 2.0 至 .NET 5。上手简单:只需几行代码即可创建折线图、条形图、饼图、散点图等。性能...

收录时间: 2021-11-27
分类: 类库组件
贡献者: Rector
63 热度

.NET Core中的鉴权授权正确方式(.NET5)

前后端分离的站点一般都会用jwt或IdentityServer4之类的生成token的方式进行登录鉴权。这里要说的是小项目没有做前后端分离的时站点登录授权的正确方式。二、传统的授权方式这里说一下传统授权方式,传统授权方式用session或cookies来完成。1.在请求某个Action之前去做校验,验证当前操作者是否登录过,登录过就有权限2.如果没有权限就跳转到登录页中去3.传统登录授权用的AOP-Filter:ActionFilter。

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

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
51 热度

Should you publish Domain Events or Integration Events?

Common advice is to not publish domain events outside of your service boundary. They should only exist within your service boundary. Instead, you should publish integration events for other service boundaries. While this general advice makes sense, it’s not so cut-and-dry. There are many reasons why you would want to publish domain events for other services to consume. Here are how I think of Domain Events and Integration Events and when to use them.

收录时间: 2021-11-25
分类: 架构设计
贡献者: Rector
40 热度

What’s New in C# 10: Write Less Code and Reduce Repeated Using Directives

This is part of a series on the new features introduced with C# 10. There are 2 related features in C# 10 that will reduce the clutter of repetitive using directives: global using directives and implicit global using directives.

收录时间: 2021-11-25
分类: C#
贡献者: Rector
46 热度

[CallerArgumentExpression] and throw helpers: Exploring .NET Core 6 - Part 11

In this post I describe a new feature in C# 10, the [CallerArgumentExpression] attribute, how it can be used to create "throw helpers", and the addition of a throw helper to ArgumentNullException.

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

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

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

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

Elasticsearch写入数据的过程是什么样的?以及是如何快速更新索引数据的?

最近面试过程中遇到问Elasticsearch的问题不少,这次总结一下,然后顺便也了解一下Elasticsearch内部是一个什么样的结构,毕竟总不能就只了解个倒排索引吧。本文标题就是我遇到过的两个问题,所以此次基本上只是围绕着这两个问题来总结。

收录时间: 2021-11-23
分类: Elasticsearch
贡献者: Rector
49 热度

Don't Code Tired | What’s New in C# 10: Simplify Argument Null Checking Code

This is part of a serieson the new features introduced with C# 10. Prior to C# 10 you may have had code similar to the following...

收录时间: 2021-11-23
分类: C#
贡献者: Rector
AD 友情赞助
52 热度

Why I don’t like layered architecture for microservices

Many organisations are migrating to making use of the Microservice philosophies in developing systems. Generally this makes complete sense and can potentially provide dramatic performance benefits. However, unfortunately many organisations make the same mistakes when it comes to implementing their microservices.

收录时间: 2021-11-23
分类: 微服务
贡献者: Rector
53 热度

DateOnly and TimeOnly support with System.Text.Json

In .NET 6.0 we finally have DateOnly and TimeOnly, two long-awaited data types that allow to store, respectively, only a date (i.e., a birth date or an invoice date) or a time in day (for example, a recurring time for a meeting).

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

.NET 6 Hot Reload and "Refused to connect to ws: because it violates the Content Security Policy directive" because Web Sockets

If you're excited about Hot Reload like me AND you also want an "A" grade from SecurityHeaders.com (really, go try this now) then you will learn very quickly about Content-Security-Policy headers. You need to spend some time reading and you may end up with a somewhat sophisticated list of allowed things, scripts, stylesheets, etc.

收录时间: 2021-11-22
分类: .NET 6
贡献者: Rector
42 热度

Working with model validation in Minimal APIs

This post is about implementing model validation in ASP.NET Core Minimal APIs. Minimal APIs do not come with any built-in support for validation. In this post we will explore how to build one and we explore will use some other libraries which can be used to implement validations.

收录时间: 2021-11-18
分类: .NET 6
贡献者: Rector
63 热度

New dependency injection features in .NET 6: Exploring .NET Core 6 - Part 10

In this post I talk about some of the new features added to Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.DependencyInjection.Abstractions in .NET 6. Some of these were added to resolve existing bugs and edge cases, and others were added to support the new minimal APIs introduced in ASP.NET Core in .NET 6.

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