简体   繁体   English

对 IntelliSense 隐藏属性

[英]Hide property from IntelliSense

How do I hide the Base64EncodedCertificate property from viewing in IntelliSense?如何在 IntelliSense 中隐藏Base64EncodedCertificate属性以使其无法查看?

I tried those following attribute options and they don't work.我尝试了以下属性选项,但它们不起作用。

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; }
}

You didn't mark the question as ef related, but from the comment on the property in the source code -您没有将问题标记为 ef 相关,而是从源代码中对该属性的评论中 -

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

if i get it right, you're using it only for queries / insert / update, and if this is the case you can hide the member using shadow properties or backing fields without public properties如果我做对了,您仅将它用于查询/插入/更新,如果是这种情况,您可以使用影子属性没有公共属性的支持字段隐藏成员

Maybe you have ReSharper installed?也许您安装了 ReSharper? Then try to look this option:然后尝试查看此选项:

ReSharper 智能感知

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从IntelliSense隐藏名称空间或更改建议名称空间的顺序(自定义IntelliSense) - Hide namespace from IntelliSense or change order of suggested namespaces (Customizing IntelliSense) 隐藏从intellisense继承的一些方法 - Hide some inherited methods from intellisense 如何在 IntelliSense 中隐藏公共方法 - How to hide public methods from IntelliSense 如何仅在 C# Editor IntelliSense 中隐藏公共类? - How to hide public classes from being seen in C# Editor IntelliSense only? 自定义依赖项属性未显示在Intellisense中 - Custom Dependency Property not showing in Intellisense 如何从子类中隐藏父级属性 - how to hide parent property from child class 从内容页面删除/隐藏继承的属性 - Remove / hide an inherited property from Content Page 隐藏模型属性以免在 Swagger 中记录 - Hide Model Property from being documented in Swagger 如何隐藏“基于最近编辑”的 Intellisense 建议? - How to hide Intellisense "based on recent edits" suggestions? 当项目是VS2013解决方案的一部分时,如何从智能感知和主类代码文件中隐藏方法重载? - how to hide method overloads from intellisense and main class code file when project is part of VS2013 solution?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM