From 7a504f8548b493a3e5ece54a12ac1f34a1633d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Standa=20Luke=C5=A1?= Date: Sat, 28 Dec 2024 19:57:05 +0100 Subject: [PATCH] v5 cleanup: Remove the obsolete context.IsPostback setter --- .../Framework/Hosting/DotvvmRequestContext.cs | 11 +---------- .../Framework/Hosting/IDotvvmRequestContext.cs | 2 +- .../Framework/Testing/TestDotvvmRequestContext.cs | 6 +----- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/Framework/Framework/Hosting/DotvvmRequestContext.cs b/src/Framework/Framework/Hosting/DotvvmRequestContext.cs index 35f5aa890f..757b7efee9 100644 --- a/src/Framework/Framework/Hosting/DotvvmRequestContext.cs +++ b/src/Framework/Framework/Hosting/DotvvmRequestContext.cs @@ -26,16 +26,7 @@ public class DotvvmRequestContext : IDotvvmRequestContext /// /// Determines whether this HTTP request is a postback or a classic GET request. /// - public bool IsPostBack - { - get => RequestType == DotvvmRequestType.Command; - set - { - // TODO: remove this setter - if (value) RequestType = DotvvmRequestType.Command; - else if (RequestType == DotvvmRequestType.Command) RequestType = DotvvmRequestType.Navigate; - } - } + public bool IsPostBack => RequestType == DotvvmRequestType.Command; /// /// Determines type of the request - initial GET, command, staticCommand, ... diff --git a/src/Framework/Framework/Hosting/IDotvvmRequestContext.cs b/src/Framework/Framework/Hosting/IDotvvmRequestContext.cs index 75c23a54f2..c045df7877 100644 --- a/src/Framework/Framework/Hosting/IDotvvmRequestContext.cs +++ b/src/Framework/Framework/Hosting/IDotvvmRequestContext.cs @@ -53,7 +53,7 @@ public interface IDotvvmRequestContext /// /// Determines whether this HTTP request is a command executing POST request. /// - bool IsPostBack { get; set; } + bool IsPostBack { get; } /// /// Determines type of the request - initial GET, command, staticCommand, ... diff --git a/src/Framework/Framework/Testing/TestDotvvmRequestContext.cs b/src/Framework/Framework/Testing/TestDotvvmRequestContext.cs index 1809f936a2..a59f982df6 100644 --- a/src/Framework/Framework/Testing/TestDotvvmRequestContext.cs +++ b/src/Framework/Framework/Testing/TestDotvvmRequestContext.cs @@ -25,11 +25,7 @@ public class TestDotvvmRequestContext : IDotvvmRequestContext public DotvvmConfiguration Configuration { get; set; } public IDotvvmPresenter Presenter { get; set; } public RouteBase Route { get; set; } - public bool IsPostBack - { - get => RequestType == DotvvmRequestType.Command; - [Obsolete("Don't do this", true)] set { } - } + public bool IsPostBack => RequestType == DotvvmRequestType.Command; public DotvvmRequestType RequestType { get; set; } = DotvvmRequestType.Navigate; public IDictionary Parameters { get; set; } public ResourceManager ResourceManager { get; set; }