Beispiel #1
0
 public Schema ConfigureFieldsInReferences(FieldNames names)
 {
     return(Clone(clone =>
     {
         clone.fieldsInReferences = names ?? FieldNames.Empty;
     }));
 }
Beispiel #2
0
        public Schema SetFieldsInReferences(FieldNames names)
        {
            names ??= FieldNames.Empty;

            if (fieldsInReferences.SequenceEqual(names))
            {
                return(this);
            }

            return(Clone(clone =>
            {
                clone.fieldsInReferences = names;
            }));
        }
Beispiel #3
0
        public Schema ConfigureFieldsInReferences(FieldNames names)
        {
            names ??= FieldNames.Empty;

            if (fieldsInReferences.DeepEquals(names))
            {
                return(this);
            }

            return(Clone(clone =>
            {
                clone.fieldsInReferences = names;
            }));
        }
        public static IEnumerable <RootField> RootFields(this Schema schema, FieldNames names)
        {
            var hasField = false;

            foreach (var name in names)
            {
                if (schema.FieldsByName.TryGetValue(name, out var field))
                {
                    hasField = true;

                    yield return(field);
                }
            }

            if (!hasField)
            {
                var first = schema.Fields.FirstOrDefault(x => !x.IsUI());

                if (first != null)
                {
                    yield return(first);
                }
            }
        }
Beispiel #5
0
 public bool DeepEquals(FieldNames names)
 {
     return(this.IsDeepEqual(names));
 }