ModelBindingResult Struct¶
Contains the result of model binding.
- Namespace
Microsoft.AspNetCore.Mvc.ModelBinding
- Assemblies
- Microsoft.AspNetCore.Mvc.Abstractions
Syntax¶
public struct ModelBindingResult : IEquatable<ModelBindingResult>
-
struct
Microsoft.AspNetCore.Mvc.ModelBinding.
ModelBindingResult
Operators¶
-
Equality
(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult, Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult)¶ Compares
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult
objects for equality.Arguments: Return type: System.Boolean
Returns: <code>true</code> if the objects are equal, otherwise <code>false</code>.
public static bool operator ==(ModelBindingResult x, ModelBindingResult y)
-
Inequality
(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult, Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult)¶ Compares
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult
objects for inequality.Arguments: Return type: System.Boolean
Returns: <code>true</code> if the objects are not equal, otherwise <code>false</code>.
public static bool operator !=(ModelBindingResult x, ModelBindingResult y)
-
Methods¶
-
Equals
(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult)¶ Return type: System.Boolean public bool Equals(ModelBindingResult other)
-
Equals
(System.Object) Return type: System.Boolean public override bool Equals(object obj)
-
Failed
()¶ Creates a
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult
representing a failed model binding operation.Return type: Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult Returns: A Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult
representing a failed model binding operation.public static ModelBindingResult Failed()
-
GetHashCode
()¶ Return type: System.Int32 public override int GetHashCode()
-
Success
(System.Object)¶ Creates a
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult
representing a successful model binding operation.Arguments: model (System.Object) – The model value. May be <code>null.</code> Return type: Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult Returns: A Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult
representing a successful model bind.public static ModelBindingResult Success(object model)
-
ToString
()¶ Return type: System.String public override string ToString()
-
Properties¶
-
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.
IsModelSet
¶ <p> Gets a value indicating whether or not the
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.Model
value has been set. </p> <p> This property can be used to distinguish between a model binder which does not find a value and the case where a model binder sets the <code>null</code> value. </p>Return type: System.Boolean public bool IsModelSet { get; }
-
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.
Model
¶ Gets the model associated with this context.
Return type: System.Object public object Model { get; }
-