Пример #1
0
 public static void ApplyConfig(HisokaOptions options)
 {
     MaxPageSize            = options.MaxPageSize;
     DefaultPageSize        = options.DefaultPageSize;
     SelectFieldsQueryAlias = options.SelectFieldsQueryAlias;
     OrderByQueryAlias      = options.OrderByQueryAlias;
     PageNumberQueryAlias   = options.PageNumberQueryAlias;
     PageSizeQueryAlias     = options.PageSizeQueryAlias;
 }
Пример #2
0
        /// <summary>
        /// Método responsável por adicionar a configuração do hisoka
        /// </summary>
        /// <param name="mvcBuilder"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static IMvcBuilder AddHisoka(this IMvcBuilder mvcBuilder, Action <HisokaOptions> options = null)
        {
            var option = new HisokaOptions();

            options?.Invoke(option);
            QueryFilterOptions.ApplyConfig(option);

            mvcBuilder.AddMvcOptions(opt =>
            {
                opt.ModelBinderProviders.Insert(0, new HisokaModelBinderProvider());
            });

            return(mvcBuilder);
        }