From 0795acca336f31c9af79b03848343f3d0b3704e0 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 9 Jul 2024 20:13:44 +0200 Subject: [PATCH] X.PagedList.Mvc.Core: Provide defaults for ToUnobtrusiveHtmlAttributes Use "Get" and "replace" which are the defaults for unobtrusive ajax here as well. This removes the nullable warning for HttpMethod. --- src/X.PagedList.Mvc.Core/AjaxOptions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/X.PagedList.Mvc.Core/AjaxOptions.cs b/src/X.PagedList.Mvc.Core/AjaxOptions.cs index 410b84d9..35ed0a10 100644 --- a/src/X.PagedList.Mvc.Core/AjaxOptions.cs +++ b/src/X.PagedList.Mvc.Core/AjaxOptions.cs @@ -62,8 +62,8 @@ public virtual IEnumerable ToUnobtrusiveHtmlAttributes() return attrs; } - public string HttpMethod { get; set; } - public InsertionMode InsertionMode { get; set; } + public string HttpMethod { get; set; } = "GET"; + public InsertionMode InsertionMode { get; set; } = InsertionMode.Replace; public string? UpdateTargetId { get; set; } public string? Confirm { get; set; } public int LoadingElementDuration { get; set; }