Exemple #1
0
 protected override void Configure(ISortInputTypeDescriptor <UserEntity> descriptor)
 {
     Name = "UserSort";
     descriptor.BindFieldsExplicitly();
     descriptor.Sortable(u => u.Id);
     descriptor.Sortable(u => u.UserName);
 }
 protected override void Configure(ISortInputTypeDescriptor <CodingSkillEntity> descriptor)
 {
     Name = "CodingSkillSort";
     descriptor.BindFieldsExplicitly();
     descriptor.Sortable(S => S.Id);
     descriptor.Sortable(s => s.Name);
     descriptor.Sortable(s => s.Level);
 }
 public SortInputTypeNameDependencyDescriptor(
     ISortInputTypeDescriptor <T> descriptor,
     Func <INamedType, NameString> createName)
 {
     _descriptor = descriptor
                   ?? throw new ArgumentNullException(nameof(descriptor));
     _createName = createName
                   ?? throw new ArgumentNullException(nameof(createName));
 }
 protected override void Configure(ISortInputTypeDescriptor <LaunchRecord> descriptor)
 {
     descriptor.BindFieldsExplicitly();
     descriptor.Field(z => z.Partner);
     descriptor.Field(z => z.Payload);
     descriptor.Field(z => z.PayloadWeightKg);
     descriptor.Field(z => z.ActualLaunchDate);
     descriptor.Field(z => z.ScheduledLaunchDate);
 }
        protected override void Configure(ISortInputTypeDescriptor <CatalogProductDto> descriptor)
        {
            descriptor
            .BindFieldsExplicitly()
            .Sortable(t => t.Name);

            descriptor
            .BindFieldsExplicitly()
            .Sortable(t => t.Price);
        }
        public static ISortInputTypeNameDependencyDescriptor <T> Name <T>(
            this ISortInputTypeDescriptor <T> descriptor,
            Func <INamedType, NameString> createName)
        {
            if (descriptor is null)
            {
                throw new ArgumentNullException(nameof(descriptor));
            }

            if (createName is null)
            {
                throw new ArgumentNullException(nameof(createName));
            }

            return(new SortInputTypeNameDependencyDescriptor <T>(descriptor, createName));
        }
Exemple #7
0
        /// <inheritdoc cref="ISortConvention"/>
        public void ApplyConfigurations(
            ITypeReference typeReference,
            ISortInputTypeDescriptor descriptor)
        {
            if (_inputTypeConfigs.TryGetValue(
                    typeReference,
                    out List <ConfigureSortInputType>?configurations))
            {
                foreach (ConfigureSortInputType configure in configurations)
                {
                    configure(descriptor);
                }

                if (descriptor is SortInputTypeDescriptor inputTypeDescriptor)
                {
                    inputTypeDescriptor.CreateDefinition();
                }
            }
        }
 public abstract void OnConfigure(
     IDescriptorContext context,
     ISortInputTypeDescriptor descriptor,
     Type type);
 protected override void Configure(ISortInputTypeDescriptor <Model> descriptor)
 {
     descriptor.Sortable(m => m.Bar).Name("qux");
 }
 protected override void Configure(ISortInputTypeDescriptor <Parent> descriptor)
 {
     descriptor.SortableObject(m => m.Model).Type <ModelSortInputType>();
 }
Exemple #11
0
 protected virtual void Configure(ISortInputTypeDescriptor descriptor)
 {
 }
Exemple #12
0
 protected override void Configure(
     ISortInputTypeDescriptor <Foo> descriptor)
 {
     descriptor.Sortable(t => t.Bar);
 }
 protected override void Configure(ISortInputTypeDescriptor <Bar> descriptor)
 {
     base.Configure(descriptor);
     descriptor.BindFieldsExplicitly().Sortable(x => x.BarProperty);
 }
Exemple #14
0
 protected override void Configure(ISortInputTypeDescriptor <ProducerDeliveriesDto> descriptor)
 {
     descriptor.Name("ProducerSort");
     descriptor.BindFieldsExplicitly();
     descriptor.Field(c => c.Name);
 }
 protected override void Configure(ISortInputTypeDescriptor <ReadyRocket> descriptor)
 {
     descriptor.BindFieldsExplicitly();
     descriptor.Field(z => z.Type);
     descriptor.Field(z => z.SerialNumber);
 }
Exemple #16
0
 protected override void Configure(ISortInputTypeDescriptor descriptor)
 {
     descriptor.Field("comparable").Type <SortInputType <Bar> >();
 }
 protected override void Configure(
     ISortInputTypeDescriptor <FooNullable> descriptor)
 {
     descriptor.Field(t => t.Bar);
 }
 protected override void Configure(ISortInputTypeDescriptor <IgnoreTest> descriptor)
 {
     descriptor.Ignore(x => x.Name);
 }
Exemple #19
0
 protected override void Configure(
     ISortInputTypeDescriptor <FooNested> descriptor)
 {
     descriptor.SortableObject(t => t.Foo);
 }
 protected override void Configure(ISortInputTypeDescriptor <User> descriptor)
 {
     descriptor.Ignore(x => x.Id);
 }
Exemple #21
0
 protected override void Configure(ISortInputTypeDescriptor <Model> descriptor)
 {
     descriptor.BindFieldsExplicitly().Sortable(t => t.Bar);
 }
 protected override void Configure(ISortInputTypeDescriptor descriptor)
 {
     descriptor.Field("test").Type <DefaultSortEnumType>();
 }
 protected override void Configure(ISortInputTypeDescriptor <Bar> descriptor)
 {
     descriptor.BindFieldsExplicitly().Field(m => m.Foo);
 }
 // we are disabling the default configure method so
 // that this does not lead to confusion.
 protected sealed override void Configure(
     ISortInputTypeDescriptor descriptor)
 {
     throw new NotSupportedException();
 }