/// <summary> /// 构造一个 <see cref="PrivacyDataConverter"/>。 /// </summary> /// <param name="protector">给定的 <see cref="IPrivacyDataProtector"/>。</param> /// <param name="mappingHints">给定的 <see cref="ConverterMappingHints"/>。</param> public PrivacyDataConverter(IPrivacyDataProtector protector, ConverterMappingHints mappingHints) : base(s => protector.Protect(s), s => protector.Unprotect(s), mappingHints) { }
/// <summary> /// 配置已标记隐私数据特性的属性转换集合。 /// </summary> /// <param name="builder">给定的 <see cref="EntityTypeBuilder"/>。</param> /// <param name="protector">给定的 <see cref="IPrivacyDataProtector"/>。</param> public static void ConfigurePrivacyData(this EntityTypeBuilder builder, IPrivacyDataProtector protector) => builder.ConfigurePrivacyData(new PrivacyDataConverter(protector));
/// <summary> /// 构造一个 <see cref="PrivacyDataConverter"/>。 /// </summary> /// <param name="protector">给定的 <see cref="IPrivacyDataProtector"/>。</param> public PrivacyDataConverter(IPrivacyDataProtector protector) : this(protector.NotNull(nameof(protector)), default) { }