Skip to content

Commit 88fa7bc

Browse files
committed
[up] bump to Simplify.Web 5.0
[del] .NET Explicit support
1 parent 42110df commit 88fa7bc

File tree

5 files changed

+35
-36
lines changed

5 files changed

+35
-36
lines changed

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Build Package](https://github.com/SimplifyNet/Simplify.Web.MessageBox/actions/workflows/build.yml/badge.svg)](https://github.com/SimplifyNet/Simplify.Web.MessageBox/actions/workflows/build.yml)
66
[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/nuget/Simplify.Web.MessageBox)](https://libraries.io/nuget/Simplify.Web.MessageBox)
77
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/SimplifyNet/Simplify.Web.MessageBox)](https://www.codefactor.io/repository/github/simplifynet/simplify.web.MessageBox)
8-
![Platform](https://img.shields.io/badge/platform-.NET%206.0%20%7C%20.NET%20Standard%202.1%20%7C%20.NET%20Standard%202.0%20%7C%20.NET%204.8-lightgrey)
8+
![Platform](https://img.shields.io/badge/platform-.NET%206.0%20%7C%20.NET%20Standard%202.1%20%7C%20.NET%20Standard%202.0-lightgrey)
99
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](http://makeapullrequest.com)
1010

1111
`Simplify.Web.MessageBox` is a package which provides non-interactive server side message box for [Simplify.Web](https://github.com/SimplifyNet/Simplify.Web) web-framework.
@@ -24,12 +24,10 @@ Inline templates intended to use as API responses but stylized with HTML.
2424
#### Default message box which will be added to 'MainContent' variable
2525

2626
```csharp
27-
public class MyController : Controller
27+
public class MyController : Controller2
2828
{
29-
public override ControllerResponse Invoke()
30-
{
31-
return new MessageBox("your string");
32-
}
29+
public ControllerResponse Invoke() =>
30+
new MessageBox("your string");
3331
}
3432
```
3533

@@ -38,11 +36,9 @@ public class MyController : Controller
3836
Framework execution will be stopped, message box will be returned to client without rest of the website content
3937

4038
```csharp
41-
public class MyController : Controller
39+
public class MyController : Controller2
4240
{
43-
public override ControllerResponse Invoke()
44-
{
45-
return new MessageBoxInline("your string");
46-
}
41+
public ControllerResponse Invoke() =>
42+
new MessageBoxInline("your string");
4743
}
4844
```

src/Simplify.Web.MessageBox/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [1.5.0] - Unreleased
4+
5+
### Dependencies
6+
7+
- Simplify.Web bump to 5.0
8+
9+
### Removed
10+
11+
- .NET 4.8 explicit support
12+
313
## [1.4.6] - 2023-08-21
414

515
### Removed

src/Simplify.Web.MessageBox/Responses/MessageBox.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,16 @@ public MessageBox(string text, int statusCode, MessageBoxStatus status = Message
6868
public string? Title { get; }
6969

7070
/// <summary>
71-
/// Processes this response
71+
/// Executes this response asynchronously.
7272
/// </summary>
73-
/// <returns></returns>
74-
public override Task<ControllerResponseResult> Process()
73+
public override Task<ResponseBehavior> ExecuteAsync()
7574
{
7675
Context.Response.StatusCode = StatusCode;
7776

7877
var handler = new MessageBoxHandler(TemplateFactory, StringTableManager, DataCollector);
7978

8079
handler.Show(Text, Status, Title);
8180

82-
return Task.FromResult(ControllerResponseResult.Default);
81+
return Task.FromResult(ResponseBehavior.Default);
8382
}
8483
}

src/Simplify.Web.MessageBox/Responses/MessageBoxInline.cs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,39 @@ namespace Simplify.Web.MessageBox.Responses;
55
/// <summary>
66
/// Provides inline message box response (generate inline message box and sends it to the user only, without site generation)
77
/// </summary>
8-
public class MessageBoxInline : ControllerResponse
8+
/// <remarks>
9+
/// Initializes a new instance of the <see cref="Web.MessageBox.Responses.MessageBox"/> class.
10+
/// </remarks>
11+
/// <param name="text">The message box text.</param>
12+
/// <param name="status">The message box status.</param>
13+
public class MessageBoxInline(string text, MessageBoxStatus status = MessageBoxStatus.Error) : ControllerResponse
914
{
10-
/// <summary>
11-
/// Initializes a new instance of the <see cref="Web.MessageBox.Responses.MessageBox"/> class.
12-
/// </summary>
13-
/// <param name="text">The message box text.</param>
14-
/// <param name="status">The message box status.</param>
15-
public MessageBoxInline(string text, MessageBoxStatus status = MessageBoxStatus.Error)
16-
{
17-
Text = text;
18-
Status = status;
19-
}
2015

2116
/// <summary>
2217
/// Gets the text.
2318
/// </summary>
2419
/// <value>
2520
/// The text.
2621
/// </value>
27-
public string Text { get; }
22+
public string Text { get; } = text;
2823

2924
/// <summary>
3025
/// Gets the status.
3126
/// </summary>
3227
/// <value>
3328
/// The status.
3429
/// </value>
35-
public MessageBoxStatus Status { get; }
30+
public MessageBoxStatus Status { get; } = status;
3631

3732
/// <summary>
38-
/// Processes this response
33+
/// Executes this response asynchronously.
3934
/// </summary>
40-
/// <returns></returns>
41-
public override async Task<ControllerResponseResult> Process()
35+
public override async Task<ResponseBehavior> ExecuteAsync()
4236
{
4337
var handler = new MessageBoxHandler(TemplateFactory, StringTableManager, DataCollector);
4438

45-
await ResponseWriter.WriteAsync(handler.GetInline(Text, Status), Context.Response);
39+
await ResponseWriter.WriteAsync(Context.Response, handler.GetInline(Text, Status));
4640

47-
return ControllerResponseResult.RawOutput;
41+
return ResponseBehavior.RawOutput;
4842
}
4943
}

src/Simplify.Web.MessageBox/Simplify.Web.MessageBox.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0;net48</TargetFrameworks>
3+
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0</TargetFrameworks>
44
<LangVersion>latest</LangVersion>
55
<Nullable>enable</Nullable>
66
<IncludeSymbols>true</IncludeSymbols>
77
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99

10-
<Version>1.4.6</Version>
10+
<Version>1.5-pre01</Version>
1111

1212
<Authors>Alexander Krylkov</Authors>
1313
<Product>Simplify</Product>
@@ -30,7 +30,7 @@
3030
<Content Include="Templates\App_Packages\Simplify.Web.MessageBox\OkMessageBox.tpl" />
3131
</ItemGroup>
3232
<ItemGroup>
33-
<PackageReference Include="Simplify.Web" Version="4.7.0" />
33+
<PackageReference Include="Simplify.Web" Version="5.0-pre01" />
3434
</ItemGroup>
3535
<ItemGroup>
3636
<None Include="..\..\images\icon.png" Pack="true" Visible="false" PackagePath="" />

0 commit comments

Comments
 (0)