你的位置: 码友网首页 / 资讯源列表 / ASP.NET Core 5: Make your options immutable

关于[ASP.NET Core 5: Make your options immutable]的摘要:

f you’ve been using ASP.NET Core 5 for a while, you’ll be delighted to learn that a major improvement of C# 9, in other words C# 9 (delivered with .NET 5) that allows the creation of immutable objects through Init-only properties. As a result, you’ll have the ability to set up your application options so that they’re immutable. After all, these are a kind of constants that you don’t necessarily want to change after initialization, or even ban it. So it’s possible with ASP.NET Core 5 and C# 9. If you don’t know what are Init-only properties, you can read my article here: https://anthonygiretti.com/2020/06/16/introducing-c-9-init-only-properties/

原文地址: https://anthonygiretti.com/2020/08/19/asp-net-core-5-make-your-options-immutable/

收录时间: 2020-08-20 浏览量: 1782 分类: ASP.NET Core

| 0 收藏 | 0