Skip to content

Commit 7af6ab2

Browse files
committed
[r] to file-scoped namespaces
1 parent 9ae30d3 commit 7af6ab2

14 files changed

Lines changed: 343 additions & 354 deletions

src/Simplify.Web.Swagger.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VisualStudioVersion = 17.0.32002.185
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Simplify.Web.Swagger", "Simplify.Web.Swagger\Simplify.Web.Swagger.csproj", "{DADAA79F-4C1D-499F-9662-2F0D6857F0AF}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TesterApp", "TesterApp\TesterApp.csproj", "{79926E07-AE7C-4ADE-8393-2B19164F6E94}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TesterApp", "TesterApp\TesterApp.csproj", "{79926E07-AE7C-4ADE-8393-2B19164F6E94}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Simplify.Web.Swagger/ControllerAction.cs

Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,85 +3,84 @@
33
using Microsoft.OpenApi.Models;
44
using Simplify.Web.Controllers.Meta.Routing;
55

6-
namespace Simplify.Web.Swagger
6+
namespace Simplify.Web.Swagger;
7+
8+
/// <summary>
9+
/// Provides the controller action.
10+
/// </summary>
11+
public class ControllerAction
712
{
13+
private ControllerActionNames? _names;
14+
private IControllerRoute? _controllerRoute;
15+
816
/// <summary>
9-
/// Provides the controller action.
17+
/// Gets or sets the request body.
1018
/// </summary>
11-
public class ControllerAction
12-
{
13-
private ControllerActionNames? _names;
14-
private IControllerRoute? _controllerRoute;
19+
/// <value>
20+
/// The request body.
21+
/// </value>
22+
public OpenApiRequestBody RequestBody { get; set; } = new();
1523

16-
/// <summary>
17-
/// Gets or sets the request body.
18-
/// </summary>
19-
/// <value>
20-
/// The request body.
21-
/// </value>
22-
public OpenApiRequestBody RequestBody { get; set; } = new();
23-
24-
/// <summary>
25-
/// Gets or sets the responses.
26-
/// </summary>
27-
/// <value>
28-
/// The responses.
29-
/// </value>
30-
public IDictionary<int, OpenApiResponse> Responses { get; set; } = new Dictionary<int, OpenApiResponse>();
24+
/// <summary>
25+
/// Gets or sets the responses.
26+
/// </summary>
27+
/// <value>
28+
/// The responses.
29+
/// </value>
30+
public IDictionary<int, OpenApiResponse> Responses { get; set; } = new Dictionary<int, OpenApiResponse>();
3131

32-
/// <summary>
33-
/// Gets or sets the type.
34-
/// </summary>
35-
/// <value>
36-
/// The type.
37-
/// </value>
38-
public OperationType Type { get; set; }
32+
/// <summary>
33+
/// Gets or sets the type.
34+
/// </summary>
35+
/// <value>
36+
/// The type.
37+
/// </value>
38+
public OperationType Type { get; set; }
3939

40-
/// <summary>
41-
/// Gets the path.
42-
/// </summary>
43-
/// <value>
44-
/// The path.
45-
/// </value>
40+
/// <summary>
41+
/// Gets the path.
42+
/// </summary>
43+
/// <value>
44+
/// The path.
45+
/// </value>
4646
#if NETSTANDARD2_0
47-
public string Path => ControllerRoute.Path.StartsWith("/") ? ControllerRoute.Path : "/" + ControllerRoute.Path;
47+
public string Path => ControllerRoute.Path.StartsWith("/") ? ControllerRoute.Path : "/" + ControllerRoute.Path;
4848
#else
49-
public string Path => ControllerRoute.Path.StartsWith('/') ? ControllerRoute.Path : "/" + ControllerRoute.Path;
49+
public string Path => ControllerRoute.Path.StartsWith('/') ? ControllerRoute.Path : "/" + ControllerRoute.Path;
5050

5151
#endif
5252

53-
/// <summary>
54-
/// Gets or sets the controller route.
55-
/// </summary>
56-
/// <value>
57-
/// The controller route.
58-
/// </value>
59-
/// <exception cref="InvalidOperationException">ControllerRoute is null</exception>
60-
public IControllerRoute ControllerRoute
61-
{
62-
get => _controllerRoute ?? throw new InvalidOperationException("ControllerRoute is null");
63-
set => _controllerRoute = value;
64-
}
65-
66-
/// <summary>
67-
/// Gets or sets the names.
68-
/// </summary>
69-
/// <value>
70-
/// The names.
71-
/// </value>
72-
/// <exception cref="InvalidOperationException">Names is null</exception>
73-
public ControllerActionNames Names
74-
{
75-
get => _names ?? throw new InvalidOperationException("Names is null");
76-
set => _names = value;
77-
}
53+
/// <summary>
54+
/// Gets or sets the controller route.
55+
/// </summary>
56+
/// <value>
57+
/// The controller route.
58+
/// </value>
59+
/// <exception cref="InvalidOperationException">ControllerRoute is null</exception>
60+
public IControllerRoute ControllerRoute
61+
{
62+
get => _controllerRoute ?? throw new InvalidOperationException("ControllerRoute is null");
63+
set => _controllerRoute = value;
64+
}
7865

79-
/// <summary>
80-
/// Gets or sets the value indicating whether controller requires user authorization.
81-
/// </summary>
82-
/// <value>
83-
/// <c>true</c> if this instance is authorization required; otherwise, <c>false</c>.
84-
/// </value>
85-
public bool IsAuthorizationRequired { get; set; }
66+
/// <summary>
67+
/// Gets or sets the names.
68+
/// </summary>
69+
/// <value>
70+
/// The names.
71+
/// </value>
72+
/// <exception cref="InvalidOperationException">Names is null</exception>
73+
public ControllerActionNames Names
74+
{
75+
get => _names ?? throw new InvalidOperationException("Names is null");
76+
set => _names = value;
8677
}
78+
79+
/// <summary>
80+
/// Gets or sets the value indicating whether controller requires user authorization.
81+
/// </summary>
82+
/// <value>
83+
/// <c>true</c> if this instance is authorization required; otherwise, <c>false</c>.
84+
/// </value>
85+
public bool IsAuthorizationRequired { get; set; }
8786
}
Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
namespace Simplify.Web.Swagger
1+
namespace Simplify.Web.Swagger;
2+
3+
/// <summary>
4+
/// Provides the controller action names.
5+
/// </summary>
6+
/// <remarks>
7+
/// Initializes ControllerActionNames.
8+
/// </remarks>
9+
/// <param name="name">Controller full name</param>
10+
/// <param name="groupName">Controller group name</param>
11+
/// <param name="summary">Controller summary</param>
12+
public class ControllerActionNames(string name, string groupName, string? summary = null)
213
{
314
/// <summary>
4-
/// Provides the controller action names.
15+
/// Gets or sets the controller full name
516
/// </summary>
6-
/// <remarks>
7-
/// Initializes ControllerActionNames.
8-
/// </remarks>
9-
/// <param name="name">Controller full name</param>
10-
/// <param name="groupName">Controller group name</param>
11-
/// <param name="summary">Controller summary</param>
12-
public class ControllerActionNames(string name, string groupName, string? summary = null)
13-
{
14-
/// <summary>
15-
/// Gets or sets the controller full name
16-
/// </summary>
17-
/// <value>
18-
/// The name.
19-
/// </value>
20-
public string Name { get; set; } = name;
17+
/// <value>
18+
/// The name.
19+
/// </value>
20+
public string Name { get; set; } = name;
2121

22-
/// <summary>
23-
/// Gets or sets the controller group name
24-
/// </summary>
25-
/// <value>
26-
/// The name of the group.
27-
/// </value>
28-
public string GroupName { get; set; } = groupName;
22+
/// <summary>
23+
/// Gets or sets the controller group name
24+
/// </summary>
25+
/// <value>
26+
/// The name of the group.
27+
/// </value>
28+
public string GroupName { get; set; } = groupName;
2929

30-
/// <summary>
31-
/// Gets or sets the controller summary
32-
/// </summary>
33-
/// <value>
34-
/// The summary.
35-
/// </value>
36-
public string? Summary { get; set; } = summary;
37-
}
30+
/// <summary>
31+
/// Gets or sets the controller summary
32+
/// </summary>
33+
/// <value>
34+
/// The summary.
35+
/// </value>
36+
public string? Summary { get; set; } = summary;
3837
}

0 commit comments

Comments
 (0)