You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
626 B
21 lines
626 B
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Infrastructure.Application
|
|
{
|
|
public class BaseRequest
|
|
{
|
|
[ScaffoldColumn(false)]
|
|
public List<ValidationResult> ValidationResults { get; private set; } = new List<ValidationResult>();
|
|
|
|
public bool IsValid()
|
|
{
|
|
var validationResults = new List<ValidationResult>();
|
|
if (!Validator.TryValidateObject(this, new ValidationContext(this, null, null), this.ValidationResults, true))
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
} |