Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseObjectGraphType" /> class.
 /// </summary>
 /// <param name="name">The name of the graph type as it is displayed in the __type information.</param>
 /// <param name="graphFields">The initial set of graph fields to add to this instance.</param>
 protected BaseObjectGraphType(string name, IEnumerable <IGraphField> graphFields = null)
 {
     this.Name           = Validation.ThrowIfNullWhiteSpaceOrReturn(name, nameof(name));
     _graphFields        = new GraphFieldCollection();
     this.InterfaceNames = new HashSet <string>();
     this.Publish        = true;
     if (graphFields != null)
     {
         foreach (var field in graphFields)
         {
             _graphFields.AddField(field);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Extends the specified new field.
 /// </summary>
 /// <param name="newField">The new field.</param>
 public void Extend(IGraphField newField)
 {
     _fieldSet.AddField(newField);
 }