Exemple #1
0
 protected SortInputTypeDescriptor(
     IDescriptorContext context,
     SortInputTypeDefinition definition,
     string?scope)
     : base(context)
 {
     Convention = context.GetSortConvention(scope);
     Definition = definition ?? throw new ArgumentNullException(nameof(definition));
 }
Exemple #2
0
 protected SortInputTypeDescriptor(
     IDescriptorContext context,
     string?scope)
     : base(context)
 {
     Convention             = context.GetSortConvention(scope);
     Definition.RuntimeType = typeof(object);
     Definition.EntityType  = typeof(object);
     Definition.Scope       = scope;
 }
        protected SortEnumValueDescriptor(
            IDescriptorContext context,
            string?scope,
            int value)
            : base(context, new SortEnumValueDefinition {
            Operation = value
        })
        {
            ISortConvention convention = context.GetSortConvention(scope);

            Definition.Name         = convention.GetOperationName(value);
            Definition.Description  = convention.GetOperationDescription(value);
            Definition.RuntimeValue = Definition.Name.Value;
        }
Exemple #4
0
 protected SortInputTypeDescriptor(
     IDescriptorContext context,
     Type entityType,
     string?scope)
     : base(context)
 {
     Convention            = context.GetSortConvention(scope);
     Definition.EntityType = entityType ??
                             throw new ArgumentNullException(nameof(entityType));
     Definition.RuntimeType            = typeof(object);
     Definition.Name                   = Convention.GetTypeName(entityType);
     Definition.Description            = Convention.GetTypeDescription(entityType);
     Definition.Fields.BindingBehavior = context.Options.DefaultBindingBehavior;
     Definition.Scope                  = scope;
 }
Exemple #5
0
        protected SortFieldDescriptor(
            IDescriptorContext context,
            string?scope,
            MemberInfo member)
            : base(context)
        {
            ISortConvention?convention = context.GetSortConvention(scope);

            Definition.Member = member ??
                                throw new ArgumentNullException(nameof(member));

            Definition.Name        = convention.GetFieldName(member);
            Definition.Description = convention.GetFieldDescription(member);
            Definition.Type        = convention.GetFieldType(member);
            Definition.Scope       = scope;
        }