Part of DKNet.EfCore.DtoGenerator. Replace the Quick Start Product declaration with this version; also install DKNet.EfCore.Abstractions to use [SensitiveData]:
public sealed class Product
{
public int Id { get; set; }
[System.ComponentModel.DataAnnotations.MaxLength(100)]
public string Name { get; set; } = "";
[DKNet.EfCore.Abstractions.Attributes.SensitiveData("pricing")]
public decimal Price { get; set; }
}
Attributes in System.ComponentModel.DataAnnotations and DKNet.EfCore.Abstractions.Attributes.SensitiveDataAttribute are carried with best-effort constructor/named argument serialization. Other namespaces, including JSON and custom validation attributes, are not copied.
Withhold sensitive properties from unauthorised callers describes the opt-in runtime response filter. The generator carries the role declaration; it does not authorize requests. Role-less [SensitiveData] is emitted as a bare attribute.
[SensitiveData] makes the DTO project depend on Abstractions; the analyzer itself does not reference that assembly.