ModelStateExtensions
Class
Extension methods for ModelStateDictionary.
Definition
Namespace:Kendo.Mvc.Extensions
Assembly:Kendo.Mvc.dll
Syntax:
C#
public static class ModelStateExtensions
Inheritance: objectModelStateExtensions
Inherited Members
Methods
Serializes the model state errors into a dictionary format.
C#
public static object SerializeErrors(this ModelStateDictionary modelState)
The model state dictionary.
Returns:A dictionary containing the serialized errors.
Converts the model state to a DataSource result object containing validation errors.
C#
public static object ToDataSourceResult(this ModelStateDictionary modelState)
The model state dictionary.
Returns:An object with validation errors if the model state is invalid; otherwise, an empty object.