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

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

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

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

            return(Clone(clone =>
            {
                clone.fieldsInReferences = names;
            }));
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
 public bool DeepEquals(FieldNames names)
 {
     return(this.IsDeepEqual(names));
 }