1212
1313namespace Arbiter . CommandQuery . EntityFramework ;
1414
15+ /// <summary>
16+ /// Extensions for adding Entity Framework Core support to the command/query pipeline.
17+ /// </summary>
1518public static class DomainServiceExtensions
1619{
20+ /// <summary>
21+ /// Registers entity queries with pipeline behaviors in the service collection.
22+ /// </summary>
23+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
24+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
25+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
26+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
27+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
28+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
1729 public static IServiceCollection AddEntityQueries < TContext , TEntity , TKey , TReadModel > ( this IServiceCollection services )
1830 where TContext : DbContext
1931 where TEntity : class , IHaveIdentifier < TKey > , new ( )
@@ -35,6 +47,17 @@ public static IServiceCollection AddEntityQueries<TContext, TEntity, TKey, TRead
3547 }
3648
3749
50+ /// <summary>
51+ /// Registers entity create, update and delete commands with pipeline behaviors in the service collection.
52+ /// </summary>
53+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
54+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
55+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
56+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
57+ /// <typeparam name="TCreateModel">The type of the create model</typeparam>
58+ /// <typeparam name="TUpdateModel">The type of the update model</typeparam>
59+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
60+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
3861 public static IServiceCollection AddEntityCommands < TContext , TEntity , TKey , TReadModel , TCreateModel , TUpdateModel > ( this IServiceCollection services )
3962 where TContext : DbContext
4063 where TEntity : class , IHaveIdentifier < TKey > , new ( )
@@ -58,6 +81,16 @@ public static IServiceCollection AddEntityCommands<TContext, TEntity, TKey, TRea
5881 }
5982
6083
84+ /// <summary>
85+ /// Registers entity create command with pipeline behaviors in the service collection.
86+ /// </summary>
87+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
88+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
89+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
90+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
91+ /// <typeparam name="TCreateModel">The type of the create model</typeparam>
92+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
93+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
6194 public static IServiceCollection AddEntityCreateCommand < TContext , TEntity , TKey , TReadModel , TCreateModel > ( this IServiceCollection services )
6295 where TContext : DbContext
6396 where TEntity : class , IHaveIdentifier < TKey > , new ( )
@@ -73,6 +106,16 @@ public static IServiceCollection AddEntityCreateCommand<TContext, TEntity, TKey,
73106 return services ;
74107 }
75108
109+ /// <summary>
110+ /// Registers entity update command with pipeline behaviors in the service collection.
111+ /// </summary>
112+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
113+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
114+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
115+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
116+ /// <typeparam name="TUpdateModel">The type of the update model</typeparam>
117+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
118+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
76119 public static IServiceCollection AddEntityUpdateCommand < TContext , TEntity , TKey , TReadModel , TUpdateModel > ( this IServiceCollection services )
77120 where TContext : DbContext
78121 where TEntity : class , IHaveIdentifier < TKey > , new ( )
@@ -92,6 +135,16 @@ public static IServiceCollection AddEntityUpdateCommand<TContext, TEntity, TKey,
92135 return services ;
93136 }
94137
138+ /// <summary>
139+ /// Registers entity update or insert command with pipeline behaviors in the service collection.
140+ /// </summary>
141+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
142+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
143+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
144+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
145+ /// <typeparam name="TUpdateModel">The type of the update model</typeparam>
146+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
147+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
95148 public static IServiceCollection AddEntityUpsertCommand < TContext , TEntity , TKey , TReadModel , TUpdateModel > ( this IServiceCollection services )
96149 where TContext : DbContext
97150 where TEntity : class , IHaveIdentifier < TKey > , new ( )
@@ -107,6 +160,15 @@ public static IServiceCollection AddEntityUpsertCommand<TContext, TEntity, TKey,
107160 return services ;
108161 }
109162
163+ /// <summary>
164+ /// Registers entity patch command with pipeline behaviors in the service collection.
165+ /// </summary>
166+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
167+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
168+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
169+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
170+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
171+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
110172 public static IServiceCollection AddEntityPatchCommand < TContext , TEntity , TKey , TReadModel > ( this IServiceCollection services )
111173 where TContext : DbContext
112174 where TEntity : class , IHaveIdentifier < TKey > , new ( )
@@ -121,6 +183,15 @@ public static IServiceCollection AddEntityPatchCommand<TContext, TEntity, TKey,
121183 return services ;
122184 }
123185
186+ /// <summary>
187+ /// Registers entity delete command with pipeline behaviors in the service collection.
188+ /// </summary>
189+ /// <typeparam name="TContext">The type of <see cref="DbContext"/>.</typeparam>
190+ /// <typeparam name="TEntity">The type of entity being operated on by the <see cref="DbContext"/></typeparam>
191+ /// <typeparam name="TKey">The key type for the data context entity</typeparam>
192+ /// <typeparam name="TReadModel">The type of the read model.</typeparam>
193+ /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
194+ /// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
124195 public static IServiceCollection AddEntityDeleteCommand < TContext , TEntity , TKey , TReadModel > ( this IServiceCollection services )
125196 where TContext : DbContext
126197 where TEntity : class , IHaveIdentifier < TKey > , new ( )
0 commit comments