C# Class SqlFu.ExceptionHelpers

Afficher le fichier Open project: sapiens/SqlFu

Méthodes publiques

Méthode Description
IsUniqueViolation ( this db, DbException ex, string keyName = null ) : bool

Checks is the exception was thrown because an unique constraint was violated. Can be used to implement idempotency e.g you can treat primary key violations as duplicate operations

Method Details

IsUniqueViolation() public static méthode

Checks is the exception was thrown because an unique constraint was violated. Can be used to implement idempotency e.g you can treat primary key violations as duplicate operations
public static IsUniqueViolation ( this db, DbException ex, string keyName = null ) : bool
db this
ex System.Data.Common.DbException
keyName string
Résultat bool