You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// A handler for a request that creates an entity in the specified <see cref="DbContext"/>.
12
+
/// A handler that processes an <see cref="EntityCreateCommand{TCreateModel, TReadModel}"/> by mapping the
13
+
/// create model to a new <typeparamref name="TEntity"/>, applying audit metadata, persisting the entity
14
+
/// via the specified <typeparamref name="TContext"/>, and returning the created entity as a <typeparamref name="TReadModel"/>.
13
15
/// </summary>
14
-
/// <inheritdoc/>
16
+
/// <typeparam name="TContext">The <see cref="DbContext"/> used to persist the entity.</typeparam>
17
+
/// <typeparam name="TEntity">The entity type being created. Must implement <see cref="IHaveIdentifier{TKey}"/> and have a parameterless constructor.</typeparam>
18
+
/// <typeparam name="TKey">The type of the entity's primary key.</typeparam>
19
+
/// <typeparam name="TCreateModel">The input model type containing the data for the new entity.</typeparam>
20
+
/// <typeparam name="TReadModel">The output model type returned after the entity is created.</typeparam>
@@ -20,13 +26,22 @@ public class EntityCreateCommandHandler<TContext, TEntity, TKey, TCreateModel, T
20
26
/// <summary>
21
27
/// Initializes a new instance of the <see cref="EntityCreateCommandHandler{TContext, TEntity, TKey, TCreateModel, TReadModel}"/> class.
22
28
/// </summary>
23
-
/// <inheritdoc/>
29
+
/// <param name="loggerFactory">The logger factory used to create an <see cref="ILogger"/> for this handler.</param>
30
+
/// <param name="dataContext">The <typeparamref name="TContext"/> used to persist the entity.</param>
31
+
/// <param name="mapper">The mapper used to convert between <typeparamref name="TCreateModel"/> and <typeparamref name="TEntity"/>, and to project to <typeparamref name="TReadModel"/>.</param>
32
+
/// <param name="pipeline">An optional query pipeline applied when reading back the created entity.</param>
Copy file name to clipboardExpand all lines: src/Arbiter.CommandQuery.EntityFramework/Handlers/EntityDataContextHandlerBase.cs
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -39,21 +39,26 @@ public abstract class EntityDataContextHandlerBase<TContext, TEntity, TKey, TRea
39
39
/// <summary>
40
40
/// Initializes a new instance of the <see cref="EntityDataContextHandlerBase{TContext, TEntity, TKey, TReadModel, TRequest, TResponse}"/> class.
41
41
/// </summary>
42
-
/// <inheritdoc/>
42
+
/// <param name="loggerFactory">The logger factory used to create an <see cref="ILogger"/> for this handler.</param>
43
+
/// <param name="dataContext">The <typeparamref name="TContext"/> used to access the data store.</param>
44
+
/// <param name="mapper">The <see cref="IMapper"/> used to map between entity and model types.</param>
45
+
/// <param name="pipeline">An optional <see cref="IQueryPipeline"/> applied to queries executed by this handler.</param>
46
+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="loggerFactory"/>, <paramref name="dataContext"/>, or <paramref name="mapper"/> is <see langword="null"/>.</exception>
/// A handler for a request that deletes an entity in the specified <see cref="DbContext"/>.
12
+
/// A handler that processes an <see cref="EntityDeleteCommand{TKey, TReadModel}"/> by locating the
13
+
/// <typeparamref name="TEntity"/> in the specified <typeparamref name="TContext"/>, reading it back as a
14
+
/// <typeparamref name="TReadModel"/>, then performing a soft delete (via <see cref="ITrackDeleted"/>) or a
15
+
/// hard delete, and finally saving changes.
13
16
/// </summary>
14
-
/// <inheritdoc/>
17
+
/// <typeparam name="TContext">The <see cref="DbContext"/> used to access the data store.</typeparam>
18
+
/// <typeparam name="TEntity">The entity type being deleted. Must implement <see cref="IHaveIdentifier{TKey}"/> and have a parameterless constructor.</typeparam>
19
+
/// <typeparam name="TKey">The type of the entity's primary key.</typeparam>
20
+
/// <typeparam name="TReadModel">The output model type returned after the entity is deleted.</typeparam>
@@ -20,13 +26,34 @@ public class EntityDeleteCommandHandler<TContext, TEntity, TKey, TReadModel>
20
26
/// <summary>
21
27
/// Initializes a new instance of the <see cref="EntityDeleteCommandHandler{TContext, TEntity, TKey, TReadModel}"/> class.
22
28
/// </summary>
23
-
/// <inheritdoc/>
29
+
/// <param name="loggerFactory">The logger factory used to create an <see cref="ILogger"/> for this handler.</param>
30
+
/// <param name="dataContext">The <typeparamref name="TContext"/> used to access the data store.</param>
31
+
/// <param name="mapper">The <see cref="IMapper"/> used to project <typeparamref name="TEntity"/> to <typeparamref name="TReadModel"/>.</param>
32
+
/// <param name="pipeline">An optional <see cref="IQueryPipeline"/> applied to queries executed by this handler.</param>
33
+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="loggerFactory"/>, <paramref name="dataContext"/>, or <paramref name="mapper"/> is <see langword="null"/>.</exception>
/// Queries the <see cref="DbSet{TEntity}"/> for the entity matching <c>request.Id</c>, applying any
43
+
/// optional query pipeline modifiers. If no entity is found, returns <see langword="null"/>.
44
+
/// </para>
45
+
/// <para>
46
+
/// Before deletion, the entity is read back and projected to <typeparamref name="TReadModel"/> so the
47
+
/// caller receives the state of the entity prior to deletion.
48
+
/// </para>
49
+
/// <para>
50
+
/// The delete strategy is determined by the entity's implemented interfaces:
51
+
/// <list type="bullet">
52
+
/// <item><description>If the entity implements <see cref="ITrackDeleted"/>, a soft delete is performed by setting <c>IsDeleted = true</c>.</description></item>
53
+
/// <item><description>Otherwise, the entity is hard-deleted via <see cref="DbSet{TEntity}.Remove"/>. If the entity also implements <see cref="ITrackHistory"/> and <see cref="ITrackUpdated"/>, update metadata is saved first to preserve history.</description></item>
/// A handler for a request that reads an entity in the specified <see cref="DbContext"/>.
12
+
/// A handler that processes an <see cref="EntityIdentifierQuery{TKey, TReadModel}"/> by reading a single
13
+
/// <typeparamref name="TEntity"/> by its primary key from the specified <typeparamref name="TContext"/>
14
+
/// and projecting it to a <typeparamref name="TReadModel"/>.
13
15
/// </summary>
14
-
/// <inheritdoc/>
16
+
/// <typeparam name="TContext">The <see cref="DbContext"/> used to access the data store.</typeparam>
17
+
/// <typeparam name="TEntity">The entity type being queried. Must implement <see cref="IHaveIdentifier{TKey}"/> and have a parameterless constructor.</typeparam>
18
+
/// <typeparam name="TKey">The type of the entity's primary key.</typeparam>
19
+
/// <typeparam name="TReadModel">The output model type returned after the entity is read.</typeparam>
@@ -21,13 +26,22 @@ public class EntityIdentifierQueryHandler<TContext, TEntity, TKey, TReadModel>
21
26
/// <summary>
22
27
/// Initializes a new instance of the <see cref="EntityIdentifierQueryHandler{TContext, TEntity, TKey, TReadModel}"/> class.
23
28
/// </summary>
24
-
/// <inheritdoc/>
29
+
/// <param name="loggerFactory">The logger factory used to create an <see cref="ILogger"/> for this handler.</param>
30
+
/// <param name="dataContext">The <typeparamref name="TContext"/> used to access the data store.</param>
31
+
/// <param name="mapper">The <see cref="IMapper"/> used to project <typeparamref name="TEntity"/> to <typeparamref name="TReadModel"/>.</param>
32
+
/// <param name="pipeline">An optional <see cref="IQueryPipeline"/> applied to queries executed by this handler.</param>
33
+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="loggerFactory"/>, <paramref name="dataContext"/>, or <paramref name="mapper"/> is <see langword="null"/>.</exception>
/// A handler for a request that reads a collection of entities in the specified <see cref="DbContext"/>.
12
+
/// A handler that processes an <see cref="EntityIdentifiersQuery{TKey, TReadModel}"/> by querying the
13
+
/// specified <typeparamref name="TContext"/> for all <typeparamref name="TEntity"/> instances whose primary
14
+
/// key is contained in the request's identifier list, and projecting the results to
15
+
/// <typeparamref name="TReadModel"/>.
13
16
/// </summary>
14
-
/// <inheritdoc/>
17
+
/// <typeparam name="TContext">The <see cref="DbContext"/> used to access the data store.</typeparam>
18
+
/// <typeparam name="TEntity">The entity type being queried. Must implement <see cref="IHaveIdentifier{TKey}"/> and have a parameterless constructor.</typeparam>
19
+
/// <typeparam name="TKey">The type of the entity's primary key.</typeparam>
20
+
/// <typeparam name="TReadModel">The output model type returned for each matched entity.</typeparam>
@@ -21,13 +27,24 @@ public class EntityIdentifiersQueryHandler<TContext, TEntity, TKey, TReadModel>
21
27
/// <summary>
22
28
/// Initializes a new instance of the <see cref="EntityIdentifiersQueryHandler{TContext, TEntity, TKey, TReadModel}"/> class.
23
29
/// </summary>
24
-
/// <inheritdoc/>
30
+
/// <param name="loggerFactory">The logger factory used to create an <see cref="ILogger"/> for this handler.</param>
31
+
/// <param name="dataContext">The <typeparamref name="TContext"/> used to access the data store.</param>
32
+
/// <param name="mapper">The <see cref="IMapper"/> used to project <typeparamref name="TEntity"/> to <typeparamref name="TReadModel"/>.</param>
33
+
/// <param name="pipeline">An optional <see cref="IQueryPipeline"/> applied to queries executed by this handler.</param>
34
+
/// <exception cref="ArgumentNullException">Thrown when <paramref name="loggerFactory"/>, <paramref name="dataContext"/>, or <paramref name="mapper"/> is <see langword="null"/>.</exception>
0 commit comments