You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure additional options for Coalesce runtime behavior. Current options include options for server-side validation, and options for exception handling. See individual members for details.
75
+
Configure additional options for Coalesce runtime behavior. Current options include options for server-side validation, and options for exception handling. See [CoalesceOptions Properties](#coalesceoptions-properties) below for details.
76
+
77
+
## CoalesceOptions Properties
78
+
79
+
The following properties are available on `CoalesceOptions` when using the `.Configure()` builder method:
A function that will transform an unhandled exception in API controllers into a custom `ApiResult` object that will be sent to the client. Return `null` to use the default response handling.
90
+
91
+
This allows you to customize error responses for specific exception types, such as returning a 404 status code for `FileNotFoundException`.
If `true`, Coalesce will transform some database exceptions into user-friendly messages when these exceptions occur in Save and Delete operations through `StandardBehaviors<T>`. For SQL Server, this includes foreign key constraint violations and unique index violations.
102
+
103
+
These messages respect the security configuration of your models. These messages only serve as a fallback to produce a more acceptable user experience in cases where the developer neglects to add appropriate validation or other handling of related entities.
If `true`, Coalesce will perform validation of incoming data using `ValidationAttribute`s present on your models during save operations (in `StandardBehaviors<T>.ValidateDto(SaveKind, IParameterDto<T>)`).
110
+
111
+
This can be overridden on individual Behaviors instances by setting `StandardBehaviors<T>.ValidateAttributesForSaves`.
0 commit comments