Skip to content

Commit 80ae524

Browse files
committed
Update Persist version and add ConfigureQueries extension
Dependency update and extension method enhancement - Updated Persist package version from 0.8.7 to 0.8.8 to keep dependencies current. - Added ConfigureQueries extension method to WorkContextBuilderExtensions, enabling registration of query handlers from an assembly for a given DbContext type, with comprehensive XML documentation.
1 parent 7fc4e24 commit 80ae524

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

RoyalCode.EnterprisePatterns/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<DomainVer>0.8.1</DomainVer>
1010
<DomainPreview></DomainPreview>
1111

12-
<PersistVer>0.8.7</PersistVer>
12+
<PersistVer>0.8.8</PersistVer>
1313
<PersistPreview></PersistPreview>
1414

1515
<CommandVer>0.1.0</CommandVer>

RoyalCode.EnterprisePatterns/RoyalCode.WorkContext.EntityFramework/Extensions/WorkContextBuilderExtensions.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ public static IWorkContextBuilder<TDbContext> ConfigureCommands<TDbContext>(
6060
return builder.ConfigureCommands(c => c.AddHandlersFromAssembly(assembly));
6161
}
6262

63+
/// <summary>
64+
/// Configures the work context builder to register query handlers from the specified assembly.
65+
/// </summary>
66+
/// <typeparam name="TDbContext">
67+
/// The type of the database context used by the work context builder. Must inherit from <see cref="DbContext"/>.
68+
/// </typeparam>
69+
/// <param name="builder">The work context builder to configure with query handlers.</param>
70+
/// <param name="assembly">The assembly from which query handler types will be discovered and registered.</param>
71+
/// <returns>The configured work context builder instance, enabling further configuration or building of the work context.</returns>
72+
public static IWorkContextBuilder<TDbContext> ConfigureQueries<TDbContext>(
73+
this IWorkContextBuilder<TDbContext> builder, Assembly assembly)
74+
where TDbContext : DbContext
75+
{
76+
return builder.ConfigureQueries(c => c.AddHandlersFromAssembly(assembly));
77+
}
78+
6379
/// <summary>
6480
/// Configures search criteria for all entity types in the specified assembly that implement the <see cref="IEntity"/> interface.
6581
/// </summary>

0 commit comments

Comments
 (0)