DbContext.ValidateEntity Methode

Definition

Erweiterungspunkt, der es dem Benutzer ermöglicht, die Validierung einer Entität anzupassen oder Validierungsergebnisse herauszufiltern. Wird von GetValidationErrors() aufgerufen.

protected virtual System.Data.Entity.Validation.DbEntityValidationResult ValidateEntity (System.Data.Entity.Infrastructure.DbEntityEntry entityEntry, System.Collections.Generic.IDictionary<object,object> items);
abstract member ValidateEntity : System.Data.Entity.Infrastructure.DbEntityEntry * System.Collections.Generic.IDictionary<obj, obj> -> System.Data.Entity.Validation.DbEntityValidationResult
override this.ValidateEntity : System.Data.Entity.Infrastructure.DbEntityEntry * System.Collections.Generic.IDictionary<obj, obj> -> System.Data.Entity.Validation.DbEntityValidationResult
Protected Overridable Function ValidateEntity (entityEntry As DbEntityEntry, items As IDictionary(Of Object, Object)) As DbEntityValidationResult

Parameter

entityEntry
DbEntityEntry

DbEntityEntry-Instanz, die überprüft werden soll.

items
IDictionary<Object,Object>

Benutzerdefiniertes Wörterbuch mit zusätzlichen Informationen für die benutzerdefinierte Validierung. Sie wird an ValidationContext übergeben und als Items verfügbar gemacht. Dieser Parameter ist optional und kann NULL sein.

Gibt zurück

Ergebnis der Entitätsvalidierung. Möglicherweise NULL, wenn überschrieben.

Gilt für: