Skip to content

Commit

Permalink
v5 cleanup: Remove the obsolete context.IsPostback setter
Browse files Browse the repository at this point in the history
  • Loading branch information
exyi committed Dec 28, 2024
1 parent 1fff36f commit 7a504f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
11 changes: 1 addition & 10 deletions src/Framework/Framework/Hosting/DotvvmRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ public class DotvvmRequestContext : IDotvvmRequestContext
/// <summary>
/// Determines whether this HTTP request is a postback or a classic GET request.
/// </summary>
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;

/// <summary>
/// Determines type of the request - initial GET, command, staticCommand, ...
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Framework/Hosting/IDotvvmRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public interface IDotvvmRequestContext
/// <summary>
/// Determines whether this HTTP request is a command executing POST request.
/// </summary>
bool IsPostBack { get; set; }
bool IsPostBack { get; }

/// <summary>
/// Determines type of the request - initial GET, command, staticCommand, ...
Expand Down
6 changes: 1 addition & 5 deletions src/Framework/Framework/Testing/TestDotvvmRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, object> Parameters { get; set; }
public ResourceManager ResourceManager { get; set; }
Expand Down

0 comments on commit 7a504f8

Please sign in to comment.