Esempio n. 1
0
        public Task ValidatePartialAsync(NamedContentData data)
        {
            Guard.NotNull(data, nameof(data));

            var tasks = new List <Task>();

            foreach (var fieldData in data)
            {
                var fieldName = fieldData.Key;

                if (!schema.FieldsByName.TryGetValue(fieldData.Key, out var field))
                {
                    errors.AddError("<FIELD> is not a known field", fieldName);
                }
                else
                {
                    tasks.Add(ValidateFieldPartialAsync(field, fieldData.Value));
                }
            }

            return(Task.WhenAll(tasks));
        }