public IDirectiveArgumentDescriptor Argument(NameString value) { var descriptor = new DirectiveArgumentDescriptor( Context, value.EnsureNotEmpty(nameof(value))); Arguments.Add(descriptor); return(descriptor); }
public IDirectiveArgumentDescriptor Argument( Expression <Func <T, object> > property) { if (property == null) { throw new ArgumentNullException(nameof(property)); } if (property.ExtractMember() is PropertyInfo p) { DirectiveArgumentDescriptor descriptor = Arguments.FirstOrDefault(t => t.Definition.Property == p); if (descriptor is { })
protected override void OnCompleteArguments( IDictionary <NameString, DirectiveArgumentDefinition> arguments, ISet <PropertyInfo> handledProperties) { if (Definition.Arguments.IsImplicitBinding()) { FieldDescriptorUtilities.AddImplicitFields( this, p => DirectiveArgumentDescriptor .New(Context, p) .CreateDefinition(), arguments, handledProperties); } base.OnCompleteArguments(arguments, handledProperties); }
public IDirectiveArgumentDescriptor Argument( Expression <Func <T, object> > property) { if (property == null) { throw new ArgumentNullException(nameof(property)); } if (property.ExtractMember() is PropertyInfo p) { var descriptor = new DirectiveArgumentDescriptor(Context, p); Arguments.Add(descriptor); return(descriptor); } throw new ArgumentException( TypeResources.DirectiveTypeDescriptor_OnlyProperties, nameof(property)); }
public IDirectiveArgumentDescriptor Argument( Expression <Func <T, object> > property) { if (property == null) { throw new ArgumentNullException(nameof(property)); } if (property.ExtractMember() is PropertyInfo p) { var descriptor = new DirectiveArgumentDescriptor(Context, p); Arguments.Add(descriptor); return(descriptor); } // TODO : resources throw new ArgumentException( "Only properties are allowed in this expression.", nameof(property)); }
public IDirectiveArgumentDescriptor Argument(NameString name) { DirectiveArgumentDescriptor descriptor = Arguments.FirstOrDefault(t => t.Definition.Name.Equals(name)); if (descriptor is { })