Skip to content

Commit ed1fd93

Browse files
committed
Update docs
1 parent 7f2f6f1 commit ed1fd93

File tree

6 files changed

+45
-26
lines changed

6 files changed

+45
-26
lines changed

src/OrchardCore.Modules/OrchardCore.Users/Services/SetupEventHandler.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
namespace OrchardCore.Users.Services;
77

88
/// <summary>
9-
/// Represents a setup event handler, which allows you to execute a code during the setup process.
9+
/// Handles setup events by creating the initial administrator user during application setup.
1010
/// </summary>
11-
/// <remarks>
12-
/// During setup, creates the admin user account.
13-
/// </remarks>
1411
public class SetupEventHandler : ISetupEventHandler
1512
{
1613
private readonly IUserService _userService;
@@ -20,6 +17,7 @@ public SetupEventHandler(IUserService userService)
2017
_userService = userService;
2118
}
2219

20+
/// <inheritdoc/>
2321
public Task SetupAsync(SetupContext context)
2422
{
2523
var user = new User

src/OrchardCore/OrchardCore.Setup.Abstractions/Events/ISetupEventHandler.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,33 @@
33
namespace OrchardCore.Setup.Events;
44

55
/// <summary>
6-
/// Represents a contract for handling setup events.
6+
/// Defines methods for handling setup events, including performing setup operations and marking their success or
7+
/// failure.
78
/// </summary>
9+
/// <remarks>Implement this interface to provide custom logic for setup processes that require asynchronous
10+
/// handling of configuration, initialization, or error reporting. Methods are designed to be called during the setup
11+
/// lifecycle to signal progress or outcome. Implementations should ensure thread safety if setup events may be
12+
/// triggered concurrently.
13+
/// </remarks>
814
public interface ISetupEventHandler
915
{
1016
/// <summary>
11-
/// Called during the process of setting up a new tenant.
17+
/// Performs asynchronous setup operations using the specified context.
1218
/// </summary>
13-
/// <param name="context"></param>
14-
/// <returns></returns>
19+
/// <param name="context">An object that provides configuration and state information required for the setup process. Cannot be null.</param>
20+
/// <returns>A task that represents the asynchronous setup operation.</returns>
1521
Task SetupAsync(SetupContext context) => Task.CompletedTask;
1622

1723
/// <summary>
18-
/// Called when a tenant fails to setup.
24+
/// Marks the setup operation as failed within the provided context.
1925
/// </summary>
20-
/// <returns></returns>
26+
/// <param name="context">The setup context in which the failure is recorded. Cannot be null.</param>
27+
/// <returns>A completed task that represents the asynchronous operation.</returns>
2128
Task FailedAsync(SetupContext context) => Task.CompletedTask;
2229

2330
/// <summary>
24-
/// Called when a new tenant is successfully setup.
31+
/// Returns a completed task that represents a successful asynchronous operation.
2532
/// </summary>
26-
/// <returns></returns>
33+
/// <returns>A <see cref="Task"/> that has already completed successfully.</returns>
2734
Task SucceededAsync() => Task.CompletedTask;
2835
}

src/OrchardCore/OrchardCore.Setup.Abstractions/Services/ISetupService.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,28 @@
33
namespace OrchardCore.Setup.Services;
44

55
/// <summary>
6-
/// Represents a contract for the setup service.
6+
/// Provides methods for retrieving setup recipes and performing tenant setup operations.
77
/// </summary>
8+
/// <remarks>Implementations of this interface enable the management of application setup processes, including
9+
/// listing available setup recipes and executing tenant setup. Methods are asynchronous and intended for use in
10+
/// scenarios where application initialization or configuration is required.
11+
/// </remarks>
812
public interface ISetupService
913
{
1014
/// <summary>
11-
/// Gets the setup recipes.
15+
/// Asynchronously retrieves a collection of setup recipe descriptors available for configuration.
1216
/// </summary>
13-
/// <returns>A list of <see cref="RecipeDescriptor"/>s.</returns>
17+
/// <returns>A task that represents the asynchronous operation. The task result contains an enumerable collection of <see
18+
/// cref="RecipeDescriptor"/> objects describing available setup recipes. The collection will be empty if no setup
19+
/// recipes are found.</returns>
1420
Task<IEnumerable<RecipeDescriptor>> GetSetupRecipesAsync();
1521

1622
/// <summary>
17-
/// Set up the tenant.
23+
/// Initializes the setup process asynchronously using the specified context and returns a status message upon
24+
/// completion.
1825
/// </summary>
19-
/// <param name="context">The <see cref="SetupContext"/>.</param>
20-
/// <returns> A GUID string the represents a setup execution identifier.</returns>
26+
/// <param name="context">The setup context containing configuration and parameters required for initialization. Cannot be null.</param>
27+
/// <returns>A task that represents the asynchronous operation. The task result contains a string describing the outcome of
28+
/// the setup process.</returns>
2129
Task<string> SetupAsync(SetupContext context);
2230
}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
namespace OrchardCore.Setup.Services;
22

33
/// <summary>
4-
/// Represents a contract for generating identifiers for setup users.
4+
/// Defines a contract for generating unique identifier strings for use as keys, tokens, or other distinct values.
55
/// </summary>
6+
/// <remarks>Implementations may generate identifiers using different algorithms or formats. The generated
7+
/// identifier is intended to be unique within the context of the application or system. This interface is typically
8+
/// used during setup or initialization processes where a reliable, non-colliding identifier is required.</remarks>
69
public interface ISetupUserIdGenerator
710
{
811
/// <summary>
9-
/// Generates a unique identifier for the setup user.
12+
/// Generates a unique identifier string suitable for use as a key or token.
1013
/// </summary>
14+
/// <returns>A string containing a unique identifier. The format and length of the identifier may vary depending on the
15+
/// implementation.
16+
/// </returns>
1117
string GenerateUniqueId();
1218
}

src/OrchardCore/OrchardCore.Setup.Core/Services/SetupService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
namespace OrchardCore.Setup.Services;
2020

2121
/// <summary>
22-
/// Represents a setup service, which is responsible for setting up the tenant.
22+
/// Provides services for retrieving setup recipes and performing application setup operations, including initializing
23+
/// tenants and configuring the database during the setup process.
2324
/// </summary>
2425
public class SetupService : ISetupService
2526
{

src/OrchardCore/OrchardCore.Setup.Core/Services/SetupUserIdGenerator.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using OrchardCore.Entities;
2-
using OrchardCore.Recipes.Models;
32

43
namespace OrchardCore.Setup.Services;
54

65
/// <summary>
7-
/// Represents a class that generates unique user id for setup that will be stored in <see cref="RecipeEnvironmentFeature"/>.
6+
/// Provides functionality to generate unique identifiers for setup users using a specified ID generator implementation.
87
/// </summary>
9-
/// <remarks>
10-
/// The generated user id will be used to keep track the admin user id during the setup process.
11-
/// </remarks>
8+
/// <remarks>This class acts as an adapter for the <see cref="IIdGenerator"/> interface, allowing setup user IDs
9+
/// to be generated consistently across different environments. Thread safety and uniqueness guarantees depend on the
10+
/// underlying <see cref="IIdGenerator"/> implementation.</remarks>
1211
public class SetupUserIdGenerator : ISetupUserIdGenerator
1312
{
1413
private readonly IIdGenerator _generator;

0 commit comments

Comments
 (0)