public DataMetaData(Parameter paramter)
 {
     Type       = paramter.Type;
     Value      = paramter.Value;
     Attributes = paramter.ParameterInfo.GetReflector().GetCustomAttributes();
     Errors     = new DataValidationErrorCollection();
 }
        public IDataState CreateDataState(DataValidationContext dataValidationContext)
        {
            var dataValidationErrors = new DataValidationErrorCollection();

            foreach (var error in dataValidationContext.DataMetaDatas.SelectMany(x => x.Errors))
            {
                dataValidationErrors.Add(error);
            }
            var isValid = dataValidationContext.DataMetaDatas.All(x => x.State != DataValidationState.Invalid);

            return(new DataState(isValid, dataValidationErrors));
        }
 public DataState(bool isValid, DataValidationErrorCollection dataValidationErrors)
 {
     _isDataValid = isValid;
     Errors       = dataValidationErrors ?? throw new ArgumentNullException(nameof(dataValidationErrors));
 }