Skip to content

Commit bcb5657

Browse files
committed
Merge branch 'feature/#145' into develop
2 parents fb5c700 + 4bcf4d0 commit bcb5657

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+181
-408
lines changed

src/SampleApps/SampleApp.Classic/appsettings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"SimplifyWebSettings":
33
{
44
"StringTableFiles": "Titles.xml, Messages.xml",
5-
"StaticFilesPaths": "styles, scripts, images, content, fonts, node_modules"
5+
"StaticFilesPaths": "styles, scripts, images, content, fonts, node_modules",
6+
"ErrorPageDarkStyle": true
67
}
78
}

src/Simplify.Web/ApplicationBuilderExtensions.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ private static void Register(IApplicationBuilder builder)
117117
});
118118
}
119119

120-
private static void RegisterAsTerminal(IApplicationBuilder builder)
121-
{
122-
builder.Run(SimplifyWebRequestMiddleware.Invoke);
123-
}
120+
private static void RegisterAsTerminal(IApplicationBuilder builder) => builder.Run(SimplifyWebRequestMiddleware.Invoke);
124121
}
125122
}

src/Simplify.Web/AsyncController{T}.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ public virtual T Model
3838
/// </summary>
3939
public virtual async Task ReadModelAsync()
4040
{
41-
_model = await Resolver.Resolve<IModelHandler>().ProcessAsync<T>(Resolver);
41+
var handler = Resolver.Resolve<IModelHandler>();
42+
43+
if (!handler.Processed)
44+
await handler.ProcessAsync<T>(Resolver);
45+
46+
_model = handler.GetModel<T>();
4247
}
4348
}
4449
}

src/Simplify.Web/Attributes/AuthorizeAttribute.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ public AuthorizeAttribute(string? requiredUserRoles = null)
2424
/// Initializes a new instance of the <see cref="AuthorizeAttribute"/> class.
2525
/// </summary>
2626
/// <param name="requiredUserRoles">The required user roles.</param>
27-
public AuthorizeAttribute(params string[] requiredUserRoles)
28-
{
29-
RequiredUserRoles = requiredUserRoles;
30-
}
27+
public AuthorizeAttribute(params string[] requiredUserRoles) => RequiredUserRoles = requiredUserRoles;
3128

3229
/// <summary>
3330
/// Gets the required user roles.

src/Simplify.Web/Attributes/ControllerRouteAttribute.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ public class ControllerRouteAttribute : Attribute
1212
/// Initializes a new instance of the <see cref="GetAttribute"/> class.
1313
/// </summary>
1414
/// <param name="route">The route.</param>
15-
public ControllerRouteAttribute(string route)
16-
{
17-
Route = route;
18-
}
15+
public ControllerRouteAttribute(string route) => Route = route;
1916

2017
/// <summary>
2118
/// Gets the route.

src/Simplify.Web/Attributes/PriorityAttribute.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ public class PriorityAttribute : Attribute
1212
/// Initializes a new instance of the <see cref="PriorityAttribute"/> class.
1313
/// </summary>
1414
/// <param name="priority">The execution priority.</param>
15-
public PriorityAttribute(int priority)
16-
{
17-
Priority = priority;
18-
}
15+
public PriorityAttribute(int priority) => Priority = priority;
1916

2017
/// <summary>
2118
/// Gets the priority.

src/Simplify.Web/Attributes/Setup/IgnoreControllersAttribute.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ public class IgnoreControllersAttribute : Attribute
1212
/// Initializes a new instance of the <see cref="IgnoreControllersAttribute"/> class.
1313
/// </summary>
1414
/// <param name="types">Controllers types which should be ignored by Simplify.Web</param>
15-
public IgnoreControllersAttribute(params Type[] types)
16-
{
17-
Types = types;
18-
}
15+
public IgnoreControllersAttribute(params Type[] types) => Types = types;
1916

2017
/// <summary>
2118
/// Gets the types of controllers.

src/Simplify.Web/Attributes/Setup/IgnoreTypesRegistrationAttribute.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ public class IgnoreTypesRegistrationAttribute : Attribute
1212
/// Initializes a new instance of the <see cref="IgnoreTypesRegistrationAttribute"/> class.
1313
/// </summary>
1414
/// <param name="types">Controllers or views types which should be ignored from DI container registration</param>
15-
public IgnoreTypesRegistrationAttribute(params Type[] types)
16-
{
17-
Types = types;
18-
}
15+
public IgnoreTypesRegistrationAttribute(params Type[] types) => Types = types;
1916

2017
/// <summary>
2118
/// Gets the types of controllers.

0 commit comments

Comments
 (0)