2
2
using System . Collections ;
3
3
using System . Collections . Generic ;
4
4
using JsonApiDotNetCore . Models ;
5
- using JsonApiDotNetCore . Hooks ;
6
5
7
- namespace JsonApiDotNetCore . Internal
6
+ namespace JsonApiDotNetCore . Hooks
8
7
{
9
8
/// <summary>
10
- /// A helper class that retrieves all metadata required for the hook
11
- /// executor to call resource hooks. It gets RelationshipAttributes,
12
- /// ResourceHookContainers and figures out wether hooks are actually implemented.
9
+ /// A helper class for retrieving meta data about hooks,
10
+ /// fetching database values and performing other recurring internal operations.
11
+ ///
12
+ /// Used internalyl by <see cref="ResourceHookExecutor"/>
13
13
/// </summary>
14
14
internal interface IHookExecutorHelper
15
15
{
@@ -21,10 +21,8 @@ internal interface IHookExecutorHelper
21
21
/// Also caches the retrieves containers so we don't need to reflectively
22
22
/// instantiate them multiple times.
23
23
/// </summary>
24
- /// <returns>The resource definition.</returns>
25
- /// <param name="targetEntity">Target entity type</param>
26
- /// <param name="hook">The hook to get a ResourceDefinition for.</param>
27
24
IResourceHookContainer GetResourceHookContainer ( Type targetEntity , ResourceHook hook = ResourceHook . None ) ;
25
+
28
26
/// <summary>
29
27
/// For a particular ResourceHook and for a given model type, checks if
30
28
/// the ResourceDefinition has an implementation for the hook
@@ -33,13 +31,17 @@ internal interface IHookExecutorHelper
33
31
/// Also caches the retrieves containers so we don't need to reflectively
34
32
/// instantiate them multiple times.
35
33
/// </summary>
36
- /// <returns>The resource definition.</returns>
37
- /// <typeparam name="TEntity">Target entity type</typeparam>
38
- /// <param name="hook">The hook to get a ResourceDefinition for.</param>
39
34
IResourceHookContainer < TEntity > GetResourceHookContainer < TEntity > ( ResourceHook hook = ResourceHook . None ) where TEntity : class , IIdentifiable ;
40
35
36
+ /// <summary>
37
+ /// Load the implicitly affected entities from the database for a given set of target target entities and involved relationships
38
+ /// </summary>
39
+ /// <returns>The implicitly affected entities by relationship</returns>
41
40
Dictionary < RelationshipProxy , IEnumerable > LoadImplicitlyAffected ( Dictionary < RelationshipProxy , IEnumerable > principalEntities , IEnumerable existingDependentEntities = null ) ;
42
41
42
+ /// <summary>
43
+ /// For a set of entities, loads current values from the database
44
+ /// </summary>
43
45
IEnumerable LoadDbValues ( Type entityType , IEnumerable entities , ResourceHook hook , params RelationshipProxy [ ] relationships ) ;
44
46
HashSet < TEntity > LoadDbValues < TEntity > ( IEnumerable < TEntity > entities , ResourceHook hook , params RelationshipProxy [ ] relationships ) where TEntity : class , IIdentifiable ;
45
47
}
0 commit comments