Sprache

DbContext.ValidateEntity Methode

Definition

Erweiterungspunkt, der es dem Benutzer ermöglicht, die Überprüfung einer Entität anzupassen oder Validierungsergebnisse auszufiltern. 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 Überprüfung. Es wird übergeben ValidationContext und wird als Items verfügbar gemacht. Dieser Parameter ist optional und kann null sein.

Gibt zurück

Ergebnis der Entitätsüberprüfung. Möglicherweise NULL, wenn überschrieben wird.

Gilt für: