Skip to content

Commit e00f0b7

Browse files
mvarendorff2Enterprize1
authored andcommitted
chore: add .Return() remark
1 parent 4c6d45a commit e00f0b7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Fluss/Authentication/ArbitraryUserUnitOfWorkExtension.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ public static UnitOfWorkFactory GetUserUnitOfWorkFactory(this IServiceProvider s
7070
return serviceProvider.GetRequiredService<IArbitraryUserUnitOfWorkCache>().GetUserUnitOfWorkFactory(userId);
7171
}
7272

73+
/// <summary>
74+
/// Returns a UnitOfWork that is configured to use the provided Guid for determining the current user.
75+
///
76+
/// <b>You MUST call .Return() on the result of this function once it's not required any more.</b>
77+
/// </summary>
78+
/// <param name="serviceProvider">this</param>
79+
/// <param name="userId">The id of the user that the UnitOfWork should use for authorization.</param>
80+
/// <returns>A UnitOfWork that is configured to use the provided Guid for determining the current user.</returns>
7381
public static IUnitOfWork GetUserUnitOfWork(this IServiceProvider serviceProvider, Guid userId)
7482
{
7583
return serviceProvider.GetRequiredService<IArbitraryUserUnitOfWorkCache>().GetUserUnitOfWork(userId);

src/Fluss/Authentication/SystemUser.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ public static UnitOfWorkFactory GetSystemUserUnitOfWorkFactory(this IServiceProv
99
return serviceProvider.GetUserUnitOfWorkFactory(SystemUserGuid);
1010
}
1111

12+
/// <summary>
13+
/// Returns a UnitOfWork that is configured to use the system user for authorization.
14+
///
15+
/// <b>You MUST call .Return() on the result of this function once it's not required any more.</b>
16+
/// </summary>
17+
/// <param name="serviceProvider">this</param>
18+
/// <returns>A UnitOfWork that is configured to use the system user for authorization.</returns>
1219
public static IUnitOfWork GetSystemUserUnitOfWork(this IServiceProvider serviceProvider)
1320
{
1421
return serviceProvider.GetUserUnitOfWork(SystemUserGuid);

0 commit comments

Comments
 (0)