Method Invalid
| Improve this Doc View SourceInvalid(ModelStateDictionary)
Represents a validation error that prevents the controller action from completing.
Declaration
public static Result Invalid(this ModelStateDictionary modelState)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelStateDictionary | modelState | The ModelStateDictionary containing errors to be returned to the client. |
Returns
| Type | Description |
|---|---|
| Result | An instance of type Result that does not contain a value. |
Remarks
Used in situations where the consumer provides invalid data.
Invalid(ModelStateDictionary, String)
Represents a validation error that prevents the controller action from completing.
Declaration
public static Result Invalid(this ModelStateDictionary modelState, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelStateDictionary | modelState | The ModelStateDictionary containing errors to be returned to the client. |
| String | message | An error message. |
Returns
| Type | Description |
|---|---|
| Result | An instance of type Result that does not contain a value. |
Remarks
Used in situations where the consumer provides invalid data.