共用方式為


DbEntityEntry<TEntity>.GetValidationResult 方法

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

驗證此 DbEntityEntry<TEntity> 執行個體並傳回驗證結果。

命名空間:  System.Data.Entity.Infrastructure
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")> _
Public Function GetValidationResult As DbEntityValidationResult
'用途
Dim instance As DbEntityEntry 
Dim returnValue As DbEntityValidationResult 

returnValue = instance.GetValidationResult()
[SuppressMessageAttribute("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
public DbEntityValidationResult GetValidationResult()
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1024:UsePropertiesWhereAppropriate")]
public:
DbEntityValidationResult^ GetValidationResult()
[<SuppressMessageAttribute("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")>]
member GetValidationResult : unit -> DbEntityValidationResult
public function GetValidationResult() : DbEntityValidationResult

傳回值

類型:System.Data.Entity.Validation.DbEntityValidationResult
實體驗證結果。如果覆寫 ValidateEntity(DbEntityEntry, IDictionary<Object, Object>) 方法則可能為 null。

請參閱

參考

DbEntityEntry<TEntity> 類別

System.Data.Entity.Infrastructure 命名空間