Beispiel #1
0
    /// <inheritdoc />
    public ISortFieldDescriptor Field(NameString name)
    {
        SortFieldDescriptor?fieldDescriptor =
            Fields.FirstOrDefault(t => t.Definition.Name == name);

        if (fieldDescriptor is null)
        {
            fieldDescriptor = SortFieldDescriptor.New(Context, name, Definition.Scope);
            Fields.Add(fieldDescriptor);
        }

        return(fieldDescriptor);
    }
Beispiel #2
0
    /// <inheritdoc />
    public ISortInputTypeDescriptor Ignore(NameString name)
    {
        SortFieldDescriptor?fieldDescriptor =
            Fields.FirstOrDefault(t => t.Definition.Name == name);

        if (fieldDescriptor is null)
        {
            fieldDescriptor = SortFieldDescriptor.New(
                Context,
                name,
                Definition.Scope);
            Fields.Add(fieldDescriptor);
        }

        fieldDescriptor.Ignore();
        return(this);
    }