[英]Hide namespace from IntelliSense or change order of suggested namespaces (Customizing IntelliSense)
[英]Hide property from IntelliSense
如何在 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; }
}
您沒有將問題標記為 ef 相關,而是從源代碼中對該屬性的評論中 -
// Notice:Not allowed in Source code but is used by EFCore (EFCore limitation workaround).
如果我做對了,您僅將它用於查詢/插入/更新,如果是這種情況,您可以使用影子屬性或沒有公共屬性的支持字段隱藏成員
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.