Partager via


DbContext.ValidateEntity, méthode

[Cette page concerne Entity Framework version 6. La dernière version est disponible sous le nom de package 'Entity Framework' NuGet. Pour plus d'informations sur Entity Framework, consultez msdn.com/data/ef.]

Point d'extension qui permet à l'utilisateur de personnaliser la validation d'une entité ou de filtrer les résultats de la validation. Appelée par GetValidationErrors().

Espace de noms :  System.Data.Entity
Assembly :  EntityFramework (dans EntityFramework.dll)

Syntaxe

'Déclaration
Protected Overridable Function ValidateEntity ( _
    entityEntry As DbEntityEntry, _
    items As IDictionary(Of Object, Object) _
) As DbEntityValidationResult
'Utilisation
Dim entityEntry As DbEntityEntry 
Dim items As IDictionary(Of Object, Object)
Dim returnValue As DbEntityValidationResult 

returnValue = Me.ValidateEntity(entityEntry, _
    items)
protected virtual DbEntityValidationResult ValidateEntity(
    DbEntityEntry entityEntry,
    IDictionary<Object, Object> items
)
protected:
virtual DbEntityValidationResult^ ValidateEntity(
    DbEntityEntry^ entityEntry, 
    IDictionary<Object^, Object^>^ items
)
abstract ValidateEntity : 
        entityEntry:DbEntityEntry * 
        items:IDictionary<Object, Object> -> DbEntityValidationResult  
override ValidateEntity : 
        entityEntry:DbEntityEntry * 
        items:IDictionary<Object, Object> -> DbEntityValidationResult
protected function ValidateEntity(
    entityEntry : DbEntityEntry, 
    items : IDictionary<Object, Object>
) : DbEntityValidationResult

Paramètres

Valeur de retour

Type : System.Data.Entity.Validation.DbEntityValidationResult
Résultat de la validation d'entité.Peut être null en cas de substitution.

Voir aussi

Référence

DbContext Classe

Espace de noms System.Data.Entity