[英]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如果我做对了,您仅将它用于查询/插入/更新,如果是这种情况,您可以使用影子属性或没有公共属性的支持字段隐藏成员
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.