<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xin9le</author_name>
  <author_url>https://blog.hatena.ne.jp/xin9le/</author_url>
  <blog_title>xin9le.net</blog_title>
  <blog_url>https://xin9le.hatenablog.jp/</blog_url>
  <categories>
    <anon>C#</anon>
    <anon>.NET</anon>
    <anon>Tips</anon>
  </categories>
  <description>init アクセサは大変良いです。C# 9.0 で追加された初期化のタイミングでのみプロパティに値を設定できる set アクセサです。アクセシビリティは狭ければ狭いほどコードは安全になるので、僕は set を見たらとりあえず init に置き換える勢い！ .NET 5 未満で init を利用する init アクセサは内部的にはただの set アクセサです。set アクセサに対して IsExternalInit という型と共に modreq という謎の (？) 修飾を行うことでコンパイラが init な挙動と解釈してくれます。逆に言うと IsExternalInit という型があり、それを解釈…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxin9le.hatenablog.jp%2Fentry%2F2021%2F05%2F05%2F205421&quot; title=&quot;.NET 5 未満でも C# 9.0 の init アクセサを利用する - xin9le.net&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-05-05 20:54:21</published>
  <title>.NET 5 未満でも C# 9.0 の init アクセサを利用する</title>
  <type>rich</type>
  <url>https://xin9le.hatenablog.jp/entry/2021/05/05/205421</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
