| | 1 | | using Microsoft.AspNetCore.Mvc; |
| | 2 | | using Microsoft.Extensions.DependencyInjection; |
| | 3 | | using Plainquire.Page.Mvc.ModelBinders; |
| | 4 | |
|
| | 5 | | namespace Plainquire.Page.Mvc; |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// Extensions to register entity filter extensions to MVC |
| | 9 | | /// </summary> |
| | 10 | | public static class MvcBuilderExtensions |
| | 11 | | { |
| | 12 | | /// <summary> |
| | 13 | | /// Registers page queryable specific model binders. |
| | 14 | | /// </summary> |
| | 15 | | /// <param name="mvcBuilder">The MVC builder.</param> |
| | 16 | | /// <autogeneratedoc /> |
| | 17 | | public static IMvcBuilder AddPageSupport(this IMvcBuilder mvcBuilder) |
| | 18 | | { |
| 6 | 19 | | mvcBuilder.Services.Configure<MvcOptions>(options => |
| 6 | 20 | | { |
| 6 | 21 | | options.ModelBinderProviders.Insert(0, new EntityPageModelBinderProvider()); |
| 6 | 22 | | }); |
| | 23 | |
|
| 6 | 24 | | return mvcBuilder; |
| | 25 | | } |
| | 26 | | } |