Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 对IntelliSense隐藏属性_C#_Visual Studio_Visual Studio Code - Fatal编程技术网

C# 对IntelliSense隐藏属性

C# 对IntelliSense隐藏属性,c#,visual-studio,visual-studio-code,C#,Visual Studio,Visual Studio Code,如何在IntelliSense中隐藏Base64EncodedCertificate属性 我尝试了以下属性选项,但它们不起作用 public class ThirdParty { private string _Base64EncodedCertificate = null; public Guid ThirdPartyId { get; set; } // Notice: Allowed in source code use but not allowed in EF

如何在IntelliSense中隐藏
Base64EncodedCertificate
属性

我尝试了以下属性选项,但它们不起作用

public class ThirdParty
{
    private string _Base64EncodedCertificate = null;

    public Guid ThirdPartyId { get; set; }
    // Notice: Allowed in source code use but not allowed in EFCore (EFCore doesn't support this).
    [NotMapped]
    public X509Certificate2 Certificate
    {
        get { return (_Base64EncodedCertificate == null ? null : new X509Certificate2(Convert.FromBase64String(_Base64EncodedCertificate))); }
        set { _Base64EncodedCertificate = (value == null ? null : Convert.ToBase64String(value.GetRawCertData())); }
    }
    // Notice: Not allowed in Source code but is used by EFCore (EFCore limitation workaround).
    [Browsable(false)]
    [Bindable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public string Base64EncodedCertificate
    {
        get { return _Base64EncodedCertificate; }
        private set { }
    }
    public string RawData { get; set; }
    public DateTime CreatedDate { get; set; }
}

也许你已经安装了ReSharper?然后尝试查看此选项:


您没有将该问题标记为与ef相关,但从源代码中对属性的注释中-

// Notice:Not allowed in Source code but is used by EFCore (EFCore limitation workaround).

如果我没有弄错,您只能将其用于查询/插入/更新,如果是这种情况,您可以使用或

隐藏成员。快速测试显示,当从其他解决方案引用时,该成员是隐藏的。如果是相同的解决方案,那么VisualStudio(我没有检查代码)不尊重这些设置。我猜这是故意的,因为该功能是为了防止其他开发人员看到高级成员,而不是阻止当前开发人员与这些成员一起工作。噢,哇!我不知道
支持字段
可以完成。这对我来说是新鲜事。至少我可以有更干净的代码。唷!