2023-10-12 csharpdotnet C# 12 Interceptors .NET 8 のコンパイラーに導入された実験的機能、C# 12 の interceptors を解説します。InterceptsLocation 属性を使ってコンパイル時にメソッド呼び出しを差し替える方法を紹介します。
2023-09-28 csharpdotnet Implementation type Data.AppDbContext can't be converted to service type Microsoft.AspNetCore.Identity.IUserStore AppDbContext を IUserStore に変換できないという ASP.NET Core Identity のエラーを、identity の設定に AddEntityFrameworkStores を追加して解消する方法を解説します。
2023-09-25 csharpdotnetdotnet-8 .NET 8 インターフェース階層のプロパティをシリアライズする .NET 8 ではインターフェース階層からのプロパティのシリアライズに対応し、宣言された変数の型に応じて、階層内のすべてのインターフェースのすべてのプロパティを含められるようになりました。
2023-09-21 csharpdotnetdotnet-8 .NET 8 非公開プロパティへのデシリアライズ .NET 8 で、JsonInclude 属性とパラメーター付きコンストラクターを使って、JSON を非公開プロパティにデシリアライズする方法を解説します。
2023-09-17 csharpdotnetdotnet-8 .NET 8 native AOT で JsonStringEnumConverter を使う方法 .NET 8 で追加された JsonStringEnumConverter<TEnum> を使って、System.Text.Json で native AOT 対応の enum シリアライズを行う方法を解説します。
2023-09-14 csharpdotnetdotnet-8 The type or namespace name InterceptsLocationAttribute could not be found C# interceptors の InterceptsLocationAttribute に関する CS0246 エラーを、自分で属性を定義することで解消する方法を解説します。
2023-09-11 csharpdotnetdotnet-8 .NET 8 JsonSerializerOptions を readonly としてマークする .NET 8 で MakeReadOnly を使って JsonSerializerOptions のインスタンスを読み取り専用にする方法と、IsReadOnly プロパティでそれを確認する方法を解説します。
2023-09-07 csharpdotnetdotnet-8 .NET 8 Half、Int128、UInt128 のシリアライズ .NET 8 の System.Text.Json は、Half、Int128、UInt128 という数値型のシリアライズに、組み込みで対応するようになりました。
2023-09-06 csharpdotnetdotnet-8 .NET 8 Memory<byte> は base64 としてシリアライズされる .NET 8 から、Memory<byte> と ReadOnlyMemory<byte> は Base64 文字列としてシリアライズされます。Memory<int> など他の型は引き続き JSON 配列のままです。
2023-09-05 csharpdotnetdotnet-8 .NET 8 非公開メンバーを JSON シリアライズに含める .NET 8 で JsonInclude 属性を使って、private、protected、internal なプロパティを JSON シリアライズに含める方法を解説します。