Method IsEntityValid
IsEntityValid<T, TInterface>(IEntityValidationService<T, TInterface>, T, ValidationResult)
Checks if the entity is valid based on the validation result.
public static bool IsEntityValid<T, TInterface>(this IEntityValidationService<T, TInterface> service, T entity, ValidationResult validationResult) where T : class where TInterface : class
Parameters
service
IEntityValidationService<T, TInterface>The IEntityValidationService instance.
entity
TThe entity to validate.
validationResult
ValidationResultThe validation result.
Returns
- bool
True if the entity is valid, otherwise false.
Type Parameters
T
The type of the entity.
TInterface
The interface type of the entity.
Remarks
The entity is considered valid if it is not null and the validation result is valid. If the entity implements IDataErrorInfo, it is also checked if the Error property is empty. If the entity implements INotifyDataErrorInfo, it is also checked if it has no errors.