ApiController.Validate Method

Definition

Overloads

Validate<TEntity>(TEntity)

Validates the given entity and adds the validation errors to the model state under the empty prefix, if any.

Validate<TEntity>(TEntity, String)

Validates the given entity and adds the validation errors to the model state, if any.

Validate<TEntity>(TEntity)

Validates the given entity and adds the validation errors to the model state under the empty prefix, if any.

public void Validate<TEntity> (TEntity entity);
member this.Validate : 'Entity -> unit
Public Sub Validate(Of TEntity) (entity As TEntity)

Type Parameters

TEntity

The type of the entity to be validated.

Parameters

entity
TEntity

The entity being validated.

Applies to

Validate<TEntity>(TEntity, String)

Validates the given entity and adds the validation errors to the model state, if any.

public void Validate<TEntity> (TEntity entity, string keyPrefix);
member this.Validate : 'Entity * string -> unit
Public Sub Validate(Of TEntity) (entity As TEntity, keyPrefix As String)

Type Parameters

TEntity

The type of the entity to be validated.

Parameters

entity
TEntity

The entity being validated.

keyPrefix
String

The key prefix under which the model state errors would be added in the model state.

Applies to