protected FilterFieldDescriptorBase(
     IDescriptorContext context,
     PropertyInfo property)
     : base(context)
 {
     _namingConvention = context.GetConventionOrDefault <IFilterNamingConvention>(
         FilterNamingConventionSnakeCase.Default);
     Definition.Property = property
                           ?? throw new ArgumentNullException(nameof(property));
     Definition.Name = context.Naming.GetMemberName(
         property, MemberKind.InputObjectField);
     Definition.Description = context.Naming.GetMemberDescription(
         property, MemberKind.InputObjectField);
     Definition.Type = context.Inspector.GetInputReturnType(property);
     Definition.Filters.BindingBehavior =
         context.Options.DefaultBindingBehavior;
 }
 public static T GetConventionOrDefault <T>(
     this IDescriptorContext context,
     T defaultConvention)
     where T : class, IConvention =>
 context.GetConventionOrDefault(() => defaultConvention);
 public static IFilterConvention GetFilterConvention(
     this IDescriptorContext context)
 {
     return(context.GetConventionOrDefault(FilterConvention.Default));
 }
 public static ISortingNamingConvention GetSortingNamingConvention(
     this IDescriptorContext context)
 {
     return(context.GetConventionOrDefault(SortingNamingConventionBase.Default));
 }
 public static IFilterConvention GetFilterConvention(
     this IDescriptorContext context,
     string?scope) =>
 context.GetConventionOrDefault(FilterConvention.Default);