HumanizeSqlExceptionBehavior class
namespace: Serenity.Services.SqlErrors assembly: Serenity.Net.Services
Implicit save/delete/undelete behavior that converts recognized database constraint violations (primary key, unique, foreign key, not null) into localized ValidationErrors using ISqlErrorExtractor and ToString instead of letting the raw provider exception surface as a server error.
public class HumanizeSqlExceptionBehavior : IDeleteBehaviorSync, IDeleteExceptionBehavior,
IImplicitBehavior, ISaveBehaviorSync, ISaveExceptionBehavior, IUndeleteBehaviorSync,
IUndeleteExceptionBehavior
| parameter | description |
|---|---|
| extractor | SQL error extractor. |
Public Members
| name | description |
|---|---|
| HumanizeSqlExceptionBehavior(…) | Implicit save/delete/undelete behavior that converts recognized database constraint violations (primary key, unique, foreign key, not null) into localized ValidationErrors using ISqlErrorExtractor and ToString instead of letting the raw provider exception surface as a server error. |
| ActivateFor(…) | |
| OnException(…) | (3 methods) |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | extractor is null. |
Remarks
Initializes a new instance of the class.
See Also
- interface IDeleteBehaviorSync
- interface IDeleteExceptionBehavior
- interface IImplicitBehavior
- interface ISaveBehaviorSync
- interface ISaveExceptionBehavior
- interface IUndeleteBehaviorSync
- interface IUndeleteExceptionBehavior
- Source: HumanizeSqlExceptionBehavior.cs